Remove Ansible 5

Change-Id: Icd8c33dfe1c8ffd21a717a1a94f1783c244a6b82
This commit is contained in:
James E. Blair 2022-10-11 17:03:57 -07:00
parent 81e9a51185
commit f9eb499870
33 changed files with 13 additions and 168 deletions

View File

@ -33,12 +33,6 @@
- zuul/lib/ansible*
- playbooks/zuul-stream/.*
- job:
name: zuul-stream-functional-5
parent: zuul-stream-functional
vars:
zuul_ansible_version: 5
- job:
name: zuul-stream-functional-6
parent: zuul-stream-functional
@ -308,7 +302,6 @@
files:
- web/.*
nodeset: ubuntu-jammy
- zuul-stream-functional-5
- zuul-stream-functional-6
- zuul-tox-remote
- zuul-quick-start:
@ -337,7 +330,6 @@
files:
- web/.*
nodeset: ubuntu-jammy
- zuul-stream-functional-5
- zuul-stream-functional-6
- zuul-tox-remote
- zuul-quick-start:

View File

@ -26,7 +26,7 @@ services:
- "../../../tools/:/var/zuul-tools/:z"
# NOTE(pabelanger): Be sure to update this line each time we change the
# default version of ansible for Zuul.
command: "/usr/local/lib/zuul/ansible/5/bin/ansible-playbook /var/playbooks/setup.yaml"
command: "/usr/local/lib/zuul/ansible/6/bin/ansible-playbook /var/playbooks/setup.yaml"
networks:
- zuul
zk:

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Support for Ansible version 5 has been removed. Migrate any
existing jobs which rely on this version to Ansible version 6
before upgrading.

View File

@ -1,7 +0,0 @@
- tenant:
name: tenant-one
default-ansible-version: '5'
source:
gerrit:
config-projects:
- common-config

View File

@ -29,20 +29,14 @@
# This job is used by a test case specifying a different ansible version in
# fixtures/zuul-default-ansible-version.conf
# TODO: make this something other than the Zuul default once there is
# another version of Ansible available.
- job:
name: ansible-default-zuul-conf
parent: ansible-version
vars:
test_ansible_version_major: 2
test_ansible_version_minor: 12
- job:
name: ansible-5
parent: ansible-version
ansible-version: 5
vars:
test_ansible_version_major: 2
test_ansible_version_minor: 12
test_ansible_version_minor: 13
- job:
name: ansible-6
@ -57,7 +51,6 @@
check:
jobs:
- ansible-default
- ansible-5
- ansible-6
- project:
@ -65,5 +58,4 @@
check:
jobs:
- ansible-default-zuul-conf
- ansible-5
- ansible-6

View File

@ -1,11 +0,0 @@
- tenant:
name: tenant-one
default-ansible-version: '5'
source:
gerrit:
config-projects:
- common-config
untrusted-projects:
- org/project
- bare-role
- org/ansible

View File

@ -1,9 +0,0 @@
- tenant:
name: tenant-one
default-ansible-version: '5'
source:
gerrit:
config-projects:
- common-config
untrusted-projects:
- org/project

View File

@ -114,15 +114,6 @@
ansible_network_os: foo
run: playbooks/network.yaml
- job:
name: ansible-version5-inventory
nodeset:
nodes:
- name: ubuntu-xenial
label: ubuntu-xenial
ansible-version: '5'
run: playbooks/ansible-version.yaml
- job:
name: ansible-version6-inventory
nodeset:

View File

@ -7,5 +7,4 @@
- executor-only-inventory
- group-inventory
- hostvars-inventory
- ansible-version5-inventory
- ansible-version6-inventory

View File

@ -1,20 +0,0 @@
- tenant:
name: tenant-no-default
source:
gerrit:
config-projects:
- common-config
untrusted-projects:
- org/project1
- org/project2
- tenant:
name: tenant-default-2-5
default-ansible-version: "2.5"
source:
gerrit:
config-projects:
- common-config
untrusted-projects:
- org/project1
- org/project2

View File

@ -7,7 +7,7 @@ server=127.0.0.1
tenant_config=main.yaml
relative_priority=true
# Used by ansible-default-zuul-conf job
default_ansible_version=5
default_ansible_version=6
[merger]
git_dir=/tmp/zuul-test/merger-git

View File

@ -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 = '5'
ansible_version = '6'
wait_timeout = 120
def _setUp(self):
@ -87,14 +87,6 @@ class FunctionalActionModulesMixIn:
self._run_job('shell-good', 'SUCCESS')
class TestActionModules5(AnsibleZuulTestCase, FunctionalActionModulesMixIn):
ansible_version = '5'
def setUp(self):
super().setUp()
self._setUp()
class TestActionModules6(AnsibleZuulTestCase, FunctionalActionModulesMixIn):
ansible_version = '6'

View File

@ -144,14 +144,6 @@ class FunctionalZuulJSONMixIn:
dateutil.parser.parse(play_end_time)
class TestZuulJSON5(AnsibleZuulTestCase, FunctionalZuulJSONMixIn):
ansible_version = '5'
def setUp(self):
super().setUp()
self._setUp()
class TestZuulJSON6(AnsibleZuulTestCase, FunctionalZuulJSONMixIn):
ansible_version = '6'

View File

@ -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 = '5'
ansible_version = '6'
def _setUp(self):
self.log_console_port = 19000 + int(
@ -253,15 +253,6 @@ class FunctionalZuulStreamMixIn:
self.assertLogLine(regex, text)
class TestZuulStream5(AnsibleZuulTestCase, FunctionalZuulStreamMixIn):
ansible_version = '5'
ansible_core_version = '2.12'
def setUp(self):
super().setUp()
self._setUp()
class TestZuulStream6(AnsibleZuulTestCase, FunctionalZuulStreamMixIn):
ansible_version = '6'
ansible_core_version = '2.13'

View File

@ -870,11 +870,6 @@ class ExecutorFactsMixin:
output)
class TestExecutorFacts5(AnsibleZuulTestCase, ExecutorFactsMixin):
tenant_config_file = 'config/executor-facts/main5.yaml'
ansible_major_minor = '2.12'
class TestExecutorFacts6(AnsibleZuulTestCase, ExecutorFactsMixin):
tenant_config_file = 'config/executor-facts/main6.yaml'
ansible_major_minor = '2.13'
@ -931,13 +926,6 @@ class AnsibleCallbackConfigsMixin:
output)
class TestAnsibleCallbackConfigs5(AnsibleZuulTestCase,
AnsibleCallbackConfigsMixin):
config_file = 'zuul-executor-ansible-callback.conf'
tenant_config_file = 'config/ansible-callbacks/main5.yaml'
ansible_major_minor = '2.12'
class TestAnsibleCallbackConfigs6(AnsibleZuulTestCase,
AnsibleCallbackConfigsMixin):
config_file = 'zuul-executor-ansible-callback.conf'

View File

@ -180,31 +180,6 @@ class TestInventoryShellType(TestInventoryBase):
class TestInventoryAutoPython(TestInventoryBase):
def test_auto_python_ansible5_inventory(self):
inventory = self._get_build_inventory('ansible-version5-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'], '5')
self.assertEqual(z_vars['job'], 'ansible-version5-inventory')
self.assertEqual(z_vars['message'], 'QQ==')
self.executor_server.release()
self.waitUntilSettled()
def test_auto_python_ansible6_inventory(self):
inventory = self._get_build_inventory('ansible-version6-inventory')

View File

@ -3964,11 +3964,6 @@ class FunctionalAnsibleMixIn(object):
output)
class TestAnsible5(AnsibleZuulTestCase, FunctionalAnsibleMixIn):
tenant_config_file = 'config/ansible/main5.yaml'
ansible_major_minor = '2.12'
class TestAnsible6(AnsibleZuulTestCase, FunctionalAnsibleMixIn):
tenant_config_file = 'config/ansible/main6.yaml'
ansible_major_minor = '2.13'
@ -8064,7 +8059,6 @@ class TestAnsibleVersion(AnsibleZuulTestCase):
self.assertHistory([
dict(name='ansible-default', 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)
@ -8084,7 +8078,6 @@ class TestDefaultAnsibleVersion(AnsibleZuulTestCase):
self.assertHistory([
dict(name='ansible-default-zuul-conf', 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)

View File

@ -1 +0,0 @@
../../base/action/__init__.py

View File

@ -1 +0,0 @@
../../base/action/command.py

View File

@ -1 +0,0 @@
../../base/action/command.pyi

View File

@ -1 +0,0 @@
../../base/action/zuul_return.py

View File

@ -1 +0,0 @@
../../base/callback/__init__.py

View File

@ -1 +0,0 @@
../../base/callback/zuul_json.py

View File

@ -1 +0,0 @@
../../base/callback/zuul_stream.py

View File

@ -1 +0,0 @@
../../base/callback/zuul_unreachable.py

View File

@ -1 +0,0 @@
../../base/filter/__init__.py

View File

@ -1 +0,0 @@
../../base/filter/zuul_filters.py

View File

@ -1 +0,0 @@
../../base/library/__init__.py

View File

@ -1 +0,0 @@
../../base/library/command.py

View File

@ -1 +0,0 @@
../../base/library/zuul_console.py

View File

@ -1 +0,0 @@
../logconfig.py

View File

@ -1 +0,0 @@
../paths.py

View File

@ -4,9 +4,5 @@ default_version = 6
# OpenStackSDK 0.99.0 coincides with CORS header problems in some providers
requirements = openstacksdk<0.99 openshift jmespath google-cloud-storage pywinrm boto3 azure-storage-blob ibm-cos-sdk netaddr passlib
[5]
requirements = ansible>=5.0,<6.0
deprecated = true
[6]
requirements = ansible>=6.0,<7.0