From 2d6b5c19ba2a083d4c3c1cbf656229eaf15616fa Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 14 Sep 2022 17:13:55 -0700 Subject: Remove support for Ansible 2 Versions 2.8 and 2.9 are no longer supported by the Ansible project. Change-Id: I888ddcbecadd56ced83a27ae5a6e70377dc3bf8c --- .../fixtures/config/ansible-callbacks/main28.yaml | 7 --- .../fixtures/config/ansible-callbacks/main29.yaml | 7 --- .../ansible-versions/git/common-config/zuul.yaml | 22 +--------- tests/fixtures/config/ansible/main28.yaml | 11 ----- tests/fixtures/config/ansible/main29.yaml | 11 ----- tests/fixtures/config/executor-facts/main28.yaml | 9 ---- tests/fixtures/config/executor-facts/main29.yaml | 9 ---- .../config/inventory/git/common-config/zuul.yaml | 18 -------- .../config/inventory/git/org_project/.zuul.yaml | 2 - .../config/inventory/git/org_project3/.zuul.yaml | 5 --- tests/fixtures/zuul-default-ansible-version.conf | 3 +- tests/remote/test_remote_action_modules.py | 18 +------- tests/remote/test_remote_zuul_json.py | 16 ------- tests/remote/test_remote_zuul_stream.py | 22 +--------- tests/unit/test_executor.py | 24 ----------- tests/unit/test_inventory.py | 50 ---------------------- tests/unit/test_v3.py | 14 ------ tests/unit/test_zk.py | 2 +- 18 files changed, 6 insertions(+), 244 deletions(-) delete mode 100644 tests/fixtures/config/ansible-callbacks/main28.yaml delete mode 100644 tests/fixtures/config/ansible-callbacks/main29.yaml delete mode 100644 tests/fixtures/config/ansible/main28.yaml delete mode 100644 tests/fixtures/config/ansible/main29.yaml delete mode 100644 tests/fixtures/config/executor-facts/main28.yaml delete mode 100644 tests/fixtures/config/executor-facts/main29.yaml (limited to 'tests') diff --git a/tests/fixtures/config/ansible-callbacks/main28.yaml b/tests/fixtures/config/ansible-callbacks/main28.yaml deleted file mode 100644 index 371710b4f..000000000 --- a/tests/fixtures/config/ansible-callbacks/main28.yaml +++ /dev/null @@ -1,7 +0,0 @@ -- tenant: - name: tenant-one - default-ansible-version: '2.8' - source: - gerrit: - config-projects: - - common-config diff --git a/tests/fixtures/config/ansible-callbacks/main29.yaml b/tests/fixtures/config/ansible-callbacks/main29.yaml deleted file mode 100644 index b127139a9..000000000 --- a/tests/fixtures/config/ansible-callbacks/main29.yaml +++ /dev/null @@ -1,7 +0,0 @@ -- tenant: - name: tenant-one - default-ansible-version: '2.9' - 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 e1bac5e01..497053c90 100644 --- a/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml +++ b/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml @@ -34,23 +34,7 @@ parent: ansible-version vars: test_ansible_version_major: 2 - test_ansible_version_minor: 8 - -- job: - name: ansible-28 - parent: ansible-version - ansible-version: 2.8 - vars: - test_ansible_version_major: 2 - test_ansible_version_minor: 8 - -- job: - name: ansible-29 - parent: ansible-version - ansible-version: 2.9 - vars: - test_ansible_version_major: 2 - test_ansible_version_minor: 9 + test_ansible_version_minor: 13 - job: name: ansible-5 @@ -73,8 +57,6 @@ check: jobs: - ansible-default - - ansible-28 - - ansible-29 - ansible-5 - ansible-6 @@ -83,7 +65,5 @@ check: jobs: - ansible-default-zuul-conf - - ansible-28 - - ansible-29 - ansible-5 - ansible-6 diff --git a/tests/fixtures/config/ansible/main28.yaml b/tests/fixtures/config/ansible/main28.yaml deleted file mode 100644 index f2add49c7..000000000 --- a/tests/fixtures/config/ansible/main28.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- tenant: - name: tenant-one - default-ansible-version: '2.8' - source: - gerrit: - config-projects: - - common-config - untrusted-projects: - - org/project - - bare-role - - org/ansible diff --git a/tests/fixtures/config/ansible/main29.yaml b/tests/fixtures/config/ansible/main29.yaml deleted file mode 100644 index 758292950..000000000 --- a/tests/fixtures/config/ansible/main29.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- tenant: - name: tenant-one - default-ansible-version: '2.9' - source: - gerrit: - config-projects: - - common-config - untrusted-projects: - - org/project - - bare-role - - org/ansible diff --git a/tests/fixtures/config/executor-facts/main28.yaml b/tests/fixtures/config/executor-facts/main28.yaml deleted file mode 100644 index 686899bf8..000000000 --- a/tests/fixtures/config/executor-facts/main28.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- tenant: - name: tenant-one - default-ansible-version: '2.8' - source: - gerrit: - config-projects: - - common-config - untrusted-projects: - - org/project diff --git a/tests/fixtures/config/executor-facts/main29.yaml b/tests/fixtures/config/executor-facts/main29.yaml deleted file mode 100644 index df934ff22..000000000 --- a/tests/fixtures/config/executor-facts/main29.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- tenant: - name: tenant-one - default-ansible-version: '2.9' - 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 ca687139d..97ee54fb9 100644 --- a/tests/fixtures/config/inventory/git/common-config/zuul.yaml +++ b/tests/fixtures/config/inventory/git/common-config/zuul.yaml @@ -114,24 +114,6 @@ ansible_network_os: foo run: playbooks/network.yaml -- job: - name: ansible-version28-inventory - nodeset: - nodes: - - name: ubuntu-xenial - label: ubuntu-xenial - ansible-version: '2.8' - run: playbooks/ansible-version.yaml - -- job: - name: ansible-version29-inventory - nodeset: - nodes: - - name: ubuntu-xenial - label: ubuntu-xenial - ansible-version: '2.9' - run: playbooks/ansible-version.yaml - - job: name: ansible-version5-inventory nodeset: diff --git a/tests/fixtures/config/inventory/git/org_project/.zuul.yaml b/tests/fixtures/config/inventory/git/org_project/.zuul.yaml index 69ec3127e..78f65ea83 100644 --- a/tests/fixtures/config/inventory/git/org_project/.zuul.yaml +++ b/tests/fixtures/config/inventory/git/org_project/.zuul.yaml @@ -7,7 +7,5 @@ - executor-only-inventory - group-inventory - hostvars-inventory - - ansible-version28-inventory - - ansible-version29-inventory - ansible-version5-inventory - ansible-version6-inventory diff --git a/tests/fixtures/config/inventory/git/org_project3/.zuul.yaml b/tests/fixtures/config/inventory/git/org_project3/.zuul.yaml index 6cf9faf88..0f11335da 100644 --- a/tests/fixtures/config/inventory/git/org_project3/.zuul.yaml +++ b/tests/fixtures/config/inventory/git/org_project3/.zuul.yaml @@ -2,8 +2,3 @@ check: jobs: - single-inventory - - single-inventory-list - - executor-only-inventory - - group-inventory - - hostvars-inventory - - ansible-version28-inventory diff --git a/tests/fixtures/zuul-default-ansible-version.conf b/tests/fixtures/zuul-default-ansible-version.conf index 6ec8e38df..000f27723 100644 --- a/tests/fixtures/zuul-default-ansible-version.conf +++ b/tests/fixtures/zuul-default-ansible-version.conf @@ -6,7 +6,8 @@ server=127.0.0.1 [scheduler] tenant_config=main.yaml relative_priority=true -default_ansible_version=2.8 +# Used by ansible-default-zuul-conf job +default_ansible_version=6 [merger] git_dir=/tmp/zuul-test/merger-git diff --git a/tests/remote/test_remote_action_modules.py b/tests/remote/test_remote_action_modules.py index 30e430b74..923b877c2 100644 --- a/tests/remote/test_remote_action_modules.py +++ b/tests/remote/test_remote_action_modules.py @@ -21,7 +21,7 @@ from tests.base import AnsibleZuulTestCase class FunctionalActionModulesMixIn: tenant_config_file = 'config/remote-action-modules/main.yaml' # This should be overriden in child classes. - ansible_version = '2.9' + ansible_version = '5' wait_timeout = 120 def _setUp(self): @@ -87,22 +87,6 @@ class FunctionalActionModulesMixIn: self._run_job('shell-good', 'SUCCESS') -class TestActionModules28(AnsibleZuulTestCase, FunctionalActionModulesMixIn): - ansible_version = '2.8' - - def setUp(self): - super().setUp() - self._setUp() - - -class TestActionModules29(AnsibleZuulTestCase, FunctionalActionModulesMixIn): - ansible_version = '2.9' - - def setUp(self): - super().setUp() - self._setUp() - - class TestActionModules5(AnsibleZuulTestCase, FunctionalActionModulesMixIn): ansible_version = '5' diff --git a/tests/remote/test_remote_zuul_json.py b/tests/remote/test_remote_zuul_json.py index e4510e7d1..4451c3630 100644 --- a/tests/remote/test_remote_zuul_json.py +++ b/tests/remote/test_remote_zuul_json.py @@ -144,22 +144,6 @@ class FunctionalZuulJSONMixIn: dateutil.parser.parse(play_end_time) -class TestZuulJSON28(AnsibleZuulTestCase, FunctionalZuulJSONMixIn): - ansible_version = '2.8' - - def setUp(self): - super().setUp() - self._setUp() - - -class TestZuulJSON29(AnsibleZuulTestCase, FunctionalZuulJSONMixIn): - ansible_version = '2.9' - - def setUp(self): - super().setUp() - self._setUp() - - class TestZuulJSON5(AnsibleZuulTestCase, FunctionalZuulJSONMixIn): ansible_version = '5' diff --git a/tests/remote/test_remote_zuul_stream.py b/tests/remote/test_remote_zuul_stream.py index b84c4b0d8..7a7fef08d 100644 --- a/tests/remote/test_remote_zuul_stream.py +++ b/tests/remote/test_remote_zuul_stream.py @@ -25,7 +25,7 @@ from tests.base import AnsibleZuulTestCase class FunctionalZuulStreamMixIn: tenant_config_file = 'config/remote-zuul-stream/main.yaml' # This should be overriden in child classes. - ansible_version = '2.9' + ansible_version = '5' def _setUp(self): self.log_console_port = 19000 + int( @@ -201,8 +201,6 @@ class FunctionalZuulStreamMixIn: self.assertLogLine( r'controller \| ok: Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text) self.assertLogLine('PLAY RECAP', text) - # NOTE(pabelanger): Ansible 2.8 added new stats - # skipped, rescued, ignored. self.assertLogLine( r'controller \| ok: \d+ changed: \d+ unreachable: 0 failed: 0 ' 'skipped: 0 rescued: 1 ignored: 0', text) @@ -255,24 +253,6 @@ class FunctionalZuulStreamMixIn: self.assertLogLine(regex, text) -class TestZuulStream28(AnsibleZuulTestCase, FunctionalZuulStreamMixIn): - ansible_version = '2.8' - ansible_core_version = '2.8' - - def setUp(self): - super().setUp() - self._setUp() - - -class TestZuulStream29(AnsibleZuulTestCase, FunctionalZuulStreamMixIn): - ansible_version = '2.9' - ansible_core_version = '2.9' - - def setUp(self): - super().setUp() - self._setUp() - - class TestZuulStream5(AnsibleZuulTestCase, FunctionalZuulStreamMixIn): ansible_version = '5' ansible_core_version = '2.12' diff --git a/tests/unit/test_executor.py b/tests/unit/test_executor.py index 27ca75531..31e3b74c5 100644 --- a/tests/unit/test_executor.py +++ b/tests/unit/test_executor.py @@ -870,16 +870,6 @@ class ExecutorFactsMixin: output) -class TestExecutorFacts28(AnsibleZuulTestCase, ExecutorFactsMixin): - tenant_config_file = 'config/executor-facts/main28.yaml' - ansible_major_minor = '2.8' - - -class TestExecutorFacts29(AnsibleZuulTestCase, ExecutorFactsMixin): - tenant_config_file = 'config/executor-facts/main29.yaml' - ansible_major_minor = '2.9' - - class TestExecutorFacts5(AnsibleZuulTestCase, ExecutorFactsMixin): tenant_config_file = 'config/executor-facts/main5.yaml' ansible_major_minor = '2.12' @@ -941,20 +931,6 @@ class AnsibleCallbackConfigsMixin: output) -class TestAnsibleCallbackConfigs28(AnsibleZuulTestCase, - AnsibleCallbackConfigsMixin): - config_file = 'zuul-executor-ansible-callback.conf' - tenant_config_file = 'config/ansible-callbacks/main28.yaml' - ansible_major_minor = '2.8' - - -class TestAnsibleCallbackConfigs29(AnsibleZuulTestCase, - AnsibleCallbackConfigsMixin): - config_file = 'zuul-executor-ansible-callback.conf' - tenant_config_file = 'config/ansible-callbacks/main29.yaml' - ansible_major_minor = '2.9' - - class TestAnsibleCallbackConfigs5(AnsibleZuulTestCase, AnsibleCallbackConfigsMixin): config_file = 'zuul-executor-ansible-callback.conf' diff --git a/tests/unit/test_inventory.py b/tests/unit/test_inventory.py index 83a62a0e7..acfe1a3ae 100644 --- a/tests/unit/test_inventory.py +++ b/tests/unit/test_inventory.py @@ -180,56 +180,6 @@ class TestInventoryShellType(TestInventoryBase): class TestInventoryAutoPython(TestInventoryBase): - def test_auto_python_ansible28_inventory(self): - inventory = self._get_build_inventory('ansible-version28-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['ansible_version'], '2.8') - self.assertEqual(z_vars['job'], 'ansible-version28-inventory') - self.assertEqual(z_vars['message'], 'QQ==') - - self.executor_server.release() - self.waitUntilSettled() - - def test_auto_python_ansible29_inventory(self): - inventory = self._get_build_inventory('ansible-version29-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['ansible_version'], '2.9') - self.assertEqual(z_vars['job'], 'ansible-version29-inventory') - self.assertEqual(z_vars['message'], 'QQ==') - - self.executor_server.release() - self.waitUntilSettled() - def test_auto_python_ansible5_inventory(self): inventory = self._get_build_inventory('ansible-version5-inventory') diff --git a/tests/unit/test_v3.py b/tests/unit/test_v3.py index d35b23285..a43df58fd 100644 --- a/tests/unit/test_v3.py +++ b/tests/unit/test_v3.py @@ -3843,16 +3843,6 @@ class FunctionalAnsibleMixIn(object): output) -class TestAnsible28(AnsibleZuulTestCase, FunctionalAnsibleMixIn): - tenant_config_file = 'config/ansible/main28.yaml' - ansible_major_minor = '2.8' - - -class TestAnsible29(AnsibleZuulTestCase, FunctionalAnsibleMixIn): - tenant_config_file = 'config/ansible/main29.yaml' - ansible_major_minor = '2.9' - - class TestAnsible5(AnsibleZuulTestCase, FunctionalAnsibleMixIn): tenant_config_file = 'config/ansible/main5.yaml' ansible_major_minor = '2.12' @@ -7953,8 +7943,6 @@ class TestAnsibleVersion(AnsibleZuulTestCase): self.assertHistory([ dict(name='ansible-default', result='SUCCESS', changes='1,1'), - 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) @@ -7975,8 +7963,6 @@ class TestDefaultAnsibleVersion(AnsibleZuulTestCase): self.assertHistory([ dict(name='ansible-default-zuul-conf', result='SUCCESS', changes='1,1'), - 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/tests/unit/test_zk.py b/tests/unit/test_zk.py index b1f393e47..fc6a47b93 100644 --- a/tests/unit/test_zk.py +++ b/tests/unit/test_zk.py @@ -1352,7 +1352,7 @@ class TestSystemConfigCache(ZooKeeperBaseTestCase): "use_relative_priority": True, "max_hold_expiration": 7200, "default_hold_expiration": 3600, - "default_ansible_version": "2.9", + "default_ansible_version": "5", "web_root": "/web/root", "web_status_url": "/web/status", "websocket_url": "/web/socket", -- cgit v1.2.1