diff options
author | Zuul <zuul@review.opendev.org> | 2022-09-08 21:30:00 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-09-08 21:30:00 +0000 |
commit | 3d60914a0e2cbc6017abce7caa9a16cc1e49bcc3 (patch) | |
tree | ffed75fe4ad6109c2e0b418d9ba9e9bd152c95b7 | |
parent | 47227b743f0daeac5a870ab10a29ace8ecfedaf3 (diff) | |
parent | 7949efd255e76dd63412a13edac3927bf2939b84 (diff) | |
download | zuul-3d60914a0e2cbc6017abce7caa9a16cc1e49bcc3.tar.gz |
Merge "Add Ansible 6"
32 files changed, 149 insertions, 2 deletions
diff --git a/.zuul.yaml b/.zuul.yaml index 72684c460..9d9000756 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -55,6 +55,12 @@ zuul_ansible_version: 5 - job: + name: zuul-stream-functional-6 + parent: zuul-stream-functional + vars: + zuul_ansible_version: 6 + +- job: name: zuul-tox description: | Zuul unit tests with ZooKeeper running @@ -320,6 +326,7 @@ - zuul-stream-functional-2.8 - zuul-stream-functional-2.9 - zuul-stream-functional-5 + - zuul-stream-functional-6 - zuul-tox-remote - zuul-quick-start: requires: nodepool-container-image @@ -350,6 +357,7 @@ - zuul-stream-functional-2.8 - zuul-stream-functional-2.9 - zuul-stream-functional-5 + - zuul-stream-functional-6 - zuul-tox-remote - zuul-quick-start: requires: nodepool-container-image diff --git a/releasenotes/notes/ansible-6-f939b4d160b41ec3.yaml b/releasenotes/notes/ansible-6-f939b4d160b41ec3.yaml new file mode 100644 index 000000000..c1bb9d534 --- /dev/null +++ b/releasenotes/notes/ansible-6-f939b4d160b41ec3.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Ansible version 6 is now available. The default Ansible version + is still 5, but version 6 may be selected by using + :attr:`job.ansible-version`. diff --git a/tests/fixtures/config/ansible-callbacks/main6.yaml b/tests/fixtures/config/ansible-callbacks/main6.yaml new file mode 100644 index 000000000..2467362bb --- /dev/null +++ b/tests/fixtures/config/ansible-callbacks/main6.yaml @@ -0,0 +1,7 @@ +- tenant: + name: tenant-one + default-ansible-version: '6' + source: + gerrit: + config-projects: + - common-config diff --git a/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml b/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml index 3a34a1d86..e1bac5e01 100644 --- a/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml +++ b/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml @@ -60,6 +60,14 @@ test_ansible_version_major: 2 test_ansible_version_minor: 12 +- job: + name: ansible-6 + parent: ansible-version + ansible-version: 6 + vars: + test_ansible_version_major: 2 + test_ansible_version_minor: 13 + - project: name: common-config check: @@ -68,6 +76,7 @@ - ansible-28 - ansible-29 - ansible-5 + - ansible-6 - project: name: org/project @@ -77,3 +86,4 @@ - ansible-28 - ansible-29 - ansible-5 + - ansible-6 diff --git a/tests/fixtures/config/ansible/main6.yaml b/tests/fixtures/config/ansible/main6.yaml new file mode 100644 index 000000000..7db6af6da --- /dev/null +++ b/tests/fixtures/config/ansible/main6.yaml @@ -0,0 +1,11 @@ +- tenant: + name: tenant-one + default-ansible-version: '6' + source: + gerrit: + config-projects: + - common-config + untrusted-projects: + - org/project + - bare-role + - org/ansible diff --git a/tests/fixtures/config/executor-facts/main6.yaml b/tests/fixtures/config/executor-facts/main6.yaml new file mode 100644 index 000000000..792f13402 --- /dev/null +++ b/tests/fixtures/config/executor-facts/main6.yaml @@ -0,0 +1,9 @@ +- tenant: + name: tenant-one + default-ansible-version: '6' + source: + gerrit: + config-projects: + - common-config + untrusted-projects: + - org/project diff --git a/tests/fixtures/config/inventory/git/common-config/zuul.yaml b/tests/fixtures/config/inventory/git/common-config/zuul.yaml index 6b5fe67d0..ca687139d 100644 --- a/tests/fixtures/config/inventory/git/common-config/zuul.yaml +++ b/tests/fixtures/config/inventory/git/common-config/zuul.yaml @@ -140,3 +140,12 @@ label: ubuntu-xenial ansible-version: '5' run: playbooks/ansible-version.yaml + +- job: + name: ansible-version6-inventory + nodeset: + nodes: + - name: ubuntu-xenial + label: ubuntu-xenial + ansible-version: '6' + run: playbooks/ansible-version.yaml diff --git a/tests/fixtures/config/inventory/git/org_project/.zuul.yaml b/tests/fixtures/config/inventory/git/org_project/.zuul.yaml index 1028a0ff2..69ec3127e 100644 --- a/tests/fixtures/config/inventory/git/org_project/.zuul.yaml +++ b/tests/fixtures/config/inventory/git/org_project/.zuul.yaml @@ -10,3 +10,4 @@ - ansible-version28-inventory - ansible-version29-inventory - ansible-version5-inventory + - ansible-version6-inventory diff --git a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_exception.py b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_exception.py index 6cfa0a3d0..7933f15a8 100755 --- a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_exception.py +++ b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_exception.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 def main(): diff --git a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_no_result.py b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_no_result.py index 065509d0d..0bdced5eb 100755 --- a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_no_result.py +++ b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_no_result.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 def main(): diff --git a/tests/remote/test_remote_action_modules.py b/tests/remote/test_remote_action_modules.py index bbe6db0a0..30e430b74 100644 --- a/tests/remote/test_remote_action_modules.py +++ b/tests/remote/test_remote_action_modules.py @@ -109,3 +109,11 @@ class TestActionModules5(AnsibleZuulTestCase, FunctionalActionModulesMixIn): def setUp(self): super().setUp() self._setUp() + + +class TestActionModules6(AnsibleZuulTestCase, FunctionalActionModulesMixIn): + ansible_version = '6' + + def setUp(self): + super().setUp() + self._setUp() diff --git a/tests/remote/test_remote_zuul_json.py b/tests/remote/test_remote_zuul_json.py index 120235ec9..e4510e7d1 100644 --- a/tests/remote/test_remote_zuul_json.py +++ b/tests/remote/test_remote_zuul_json.py @@ -166,3 +166,11 @@ class TestZuulJSON5(AnsibleZuulTestCase, FunctionalZuulJSONMixIn): def setUp(self): super().setUp() self._setUp() + + +class TestZuulJSON6(AnsibleZuulTestCase, FunctionalZuulJSONMixIn): + ansible_version = '6' + + def setUp(self): + super().setUp() + self._setUp() diff --git a/tests/remote/test_remote_zuul_stream.py b/tests/remote/test_remote_zuul_stream.py index 225c88e96..b84c4b0d8 100644 --- a/tests/remote/test_remote_zuul_stream.py +++ b/tests/remote/test_remote_zuul_stream.py @@ -280,3 +280,12 @@ class TestZuulStream5(AnsibleZuulTestCase, FunctionalZuulStreamMixIn): def setUp(self): super().setUp() self._setUp() + + +class TestZuulStream6(AnsibleZuulTestCase, FunctionalZuulStreamMixIn): + ansible_version = '6' + ansible_core_version = '2.13' + + def setUp(self): + super().setUp() + self._setUp() diff --git a/tests/unit/test_executor.py b/tests/unit/test_executor.py index 6296ebe59..27ca75531 100644 --- a/tests/unit/test_executor.py +++ b/tests/unit/test_executor.py @@ -885,6 +885,11 @@ class TestExecutorFacts5(AnsibleZuulTestCase, ExecutorFactsMixin): ansible_major_minor = '2.12' +class TestExecutorFacts6(AnsibleZuulTestCase, ExecutorFactsMixin): + tenant_config_file = 'config/executor-facts/main6.yaml' + ansible_major_minor = '2.13' + + class AnsibleCallbackConfigsMixin: config_file = 'zuul-executor-ansible-callback.conf' @@ -957,6 +962,13 @@ class TestAnsibleCallbackConfigs5(AnsibleZuulTestCase, ansible_major_minor = '2.12' +class TestAnsibleCallbackConfigs6(AnsibleZuulTestCase, + AnsibleCallbackConfigsMixin): + config_file = 'zuul-executor-ansible-callback.conf' + tenant_config_file = 'config/ansible-callbacks/main6.yaml' + ansible_major_minor = '2.13' + + class TestExecutorEnvironment(AnsibleZuulTestCase): tenant_config_file = 'config/zuul-environment-filter/main.yaml' diff --git a/tests/unit/test_inventory.py b/tests/unit/test_inventory.py index 9dc1b3692..83a62a0e7 100644 --- a/tests/unit/test_inventory.py +++ b/tests/unit/test_inventory.py @@ -255,6 +255,30 @@ class TestInventoryAutoPython(TestInventoryBase): self.executor_server.release() self.waitUntilSettled() + def test_auto_python_ansible6_inventory(self): + inventory = self._get_build_inventory('ansible-version6-inventory') + + all_nodes = ('ubuntu-xenial',) + self.assertIn('all', inventory) + self.assertIn('hosts', inventory['all']) + self.assertIn('vars', inventory['all']) + for node_name in all_nodes: + self.assertIn(node_name, inventory['all']['hosts']) + node_vars = inventory['all']['hosts'][node_name] + self.assertEqual( + 'auto', node_vars['ansible_python_interpreter']) + + self.assertIn('zuul', inventory['all']['vars']) + z_vars = inventory['all']['vars']['zuul'] + self.assertIn('executor', z_vars) + self.assertIn('src_root', z_vars['executor']) + self.assertIn('job', z_vars) + self.assertEqual(z_vars['job'], 'ansible-version6-inventory') + self.assertEqual(z_vars['message'], 'QQ==') + + self.executor_server.release() + self.waitUntilSettled() + class TestInventory(TestInventoryBase): diff --git a/tests/unit/test_v3.py b/tests/unit/test_v3.py index 4c2befd61..d35b23285 100644 --- a/tests/unit/test_v3.py +++ b/tests/unit/test_v3.py @@ -3858,6 +3858,11 @@ class TestAnsible5(AnsibleZuulTestCase, FunctionalAnsibleMixIn): ansible_major_minor = '2.12' +class TestAnsible6(AnsibleZuulTestCase, FunctionalAnsibleMixIn): + tenant_config_file = 'config/ansible/main6.yaml' + ansible_major_minor = '2.13' + + class TestPrePlaybooks(AnsibleZuulTestCase): # A temporary class to hold new tests while others are disabled @@ -7951,6 +7956,7 @@ class TestAnsibleVersion(AnsibleZuulTestCase): dict(name='ansible-28', result='SUCCESS', changes='1,1'), dict(name='ansible-29', result='SUCCESS', changes='1,1'), dict(name='ansible-5', result='SUCCESS', changes='1,1'), + dict(name='ansible-6', result='SUCCESS', changes='1,1'), ], ordered=False) @@ -7972,6 +7978,7 @@ class TestDefaultAnsibleVersion(AnsibleZuulTestCase): dict(name='ansible-28', result='SUCCESS', changes='1,1'), dict(name='ansible-29', result='SUCCESS', changes='1,1'), dict(name='ansible-5', result='SUCCESS', changes='1,1'), + dict(name='ansible-6', result='SUCCESS', changes='1,1'), ], ordered=False) diff --git a/zuul/ansible/6/action/__init__.py b/zuul/ansible/6/action/__init__.py new file mode 120000 index 000000000..4048e7ac1 --- /dev/null +++ b/zuul/ansible/6/action/__init__.py @@ -0,0 +1 @@ +../../base/action/__init__.py
\ No newline at end of file diff --git a/zuul/ansible/6/action/command.py b/zuul/ansible/6/action/command.py new file mode 120000 index 000000000..56c6b636f --- /dev/null +++ b/zuul/ansible/6/action/command.py @@ -0,0 +1 @@ +../../base/action/command.py
\ No newline at end of file diff --git a/zuul/ansible/6/action/command.pyi b/zuul/ansible/6/action/command.pyi new file mode 120000 index 000000000..a003281ca --- /dev/null +++ b/zuul/ansible/6/action/command.pyi @@ -0,0 +1 @@ +../../base/action/command.pyi
\ No newline at end of file diff --git a/zuul/ansible/6/action/zuul_return.py b/zuul/ansible/6/action/zuul_return.py new file mode 120000 index 000000000..83c2fc619 --- /dev/null +++ b/zuul/ansible/6/action/zuul_return.py @@ -0,0 +1 @@ +../../base/action/zuul_return.py
\ No newline at end of file diff --git a/zuul/ansible/6/callback/__init__.py b/zuul/ansible/6/callback/__init__.py new file mode 120000 index 000000000..00b974388 --- /dev/null +++ b/zuul/ansible/6/callback/__init__.py @@ -0,0 +1 @@ +../../base/callback/__init__.py
\ No newline at end of file diff --git a/zuul/ansible/6/callback/zuul_json.py b/zuul/ansible/6/callback/zuul_json.py new file mode 120000 index 000000000..b0a07779b --- /dev/null +++ b/zuul/ansible/6/callback/zuul_json.py @@ -0,0 +1 @@ +../../base/callback/zuul_json.py
\ No newline at end of file diff --git a/zuul/ansible/6/callback/zuul_stream.py b/zuul/ansible/6/callback/zuul_stream.py new file mode 120000 index 000000000..f75561bf4 --- /dev/null +++ b/zuul/ansible/6/callback/zuul_stream.py @@ -0,0 +1 @@ +../../base/callback/zuul_stream.py
\ No newline at end of file diff --git a/zuul/ansible/6/callback/zuul_unreachable.py b/zuul/ansible/6/callback/zuul_unreachable.py new file mode 120000 index 000000000..205baca6f --- /dev/null +++ b/zuul/ansible/6/callback/zuul_unreachable.py @@ -0,0 +1 @@ +../../base/callback/zuul_unreachable.py
\ No newline at end of file diff --git a/zuul/ansible/6/filter/__init__.py b/zuul/ansible/6/filter/__init__.py new file mode 120000 index 000000000..f80a4da61 --- /dev/null +++ b/zuul/ansible/6/filter/__init__.py @@ -0,0 +1 @@ +../../base/filter/__init__.py
\ No newline at end of file diff --git a/zuul/ansible/6/filter/zuul_filters.py b/zuul/ansible/6/filter/zuul_filters.py new file mode 120000 index 000000000..d406e5fe6 --- /dev/null +++ b/zuul/ansible/6/filter/zuul_filters.py @@ -0,0 +1 @@ +../../base/filter/zuul_filters.py
\ No newline at end of file diff --git a/zuul/ansible/6/library/__init__.py b/zuul/ansible/6/library/__init__.py new file mode 120000 index 000000000..0b68ce0f4 --- /dev/null +++ b/zuul/ansible/6/library/__init__.py @@ -0,0 +1 @@ +../../base/library/__init__.py
\ No newline at end of file diff --git a/zuul/ansible/6/library/command.py b/zuul/ansible/6/library/command.py new file mode 120000 index 000000000..9c7633169 --- /dev/null +++ b/zuul/ansible/6/library/command.py @@ -0,0 +1 @@ +../../base/library/command.py
\ No newline at end of file diff --git a/zuul/ansible/6/library/zuul_console.py b/zuul/ansible/6/library/zuul_console.py new file mode 120000 index 000000000..7c905e0f9 --- /dev/null +++ b/zuul/ansible/6/library/zuul_console.py @@ -0,0 +1 @@ +../../base/library/zuul_console.py
\ No newline at end of file diff --git a/zuul/ansible/6/logconfig.py b/zuul/ansible/6/logconfig.py new file mode 120000 index 000000000..767cb2e81 --- /dev/null +++ b/zuul/ansible/6/logconfig.py @@ -0,0 +1 @@ +../logconfig.py
\ No newline at end of file diff --git a/zuul/ansible/6/paths.py b/zuul/ansible/6/paths.py new file mode 120000 index 000000000..dbdb1858e --- /dev/null +++ b/zuul/ansible/6/paths.py @@ -0,0 +1 @@ +../paths.py
\ No newline at end of file diff --git a/zuul/lib/ansible-config.conf b/zuul/lib/ansible-config.conf index 9fdc905b9..35a9f59fe 100644 --- a/zuul/lib/ansible-config.conf +++ b/zuul/lib/ansible-config.conf @@ -18,3 +18,6 @@ deprecated = true [5] requirements = ansible>=5.0,<6.0 + +[6] +requirements = ansible>=6.0,<7.0 |