Add Ansible 6

Change-Id: I0d450d9385b9aaab22d2d87fb47798bf56525f50
This commit is contained in:
James E. Blair 2022-08-17 15:29:14 -07:00
parent ad03402dec
commit 7949efd255
32 changed files with 149 additions and 2 deletions

View File

@ -54,6 +54,12 @@
vars:
zuul_ansible_version: 5
- job:
name: zuul-stream-functional-6
parent: zuul-stream-functional
vars:
zuul_ansible_version: 6
- job:
name: zuul-tox
description: |
@ -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

View File

@ -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`.

View File

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

View File

@ -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

View File

@ -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

View File

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

View File

@ -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

View File

@ -10,3 +10,4 @@
- ansible-version28-inventory
- ansible-version29-inventory
- ansible-version5-inventory
- ansible-version6-inventory

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
def main():

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
def main():

View File

@ -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()

View File

@ -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()

View File

@ -238,3 +238,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()

View File

@ -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'

View File

@ -249,6 +249,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):

View File

@ -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)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

1
zuul/ansible/6/logconfig.py Symbolic link
View File

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

1
zuul/ansible/6/paths.py Symbolic link
View File

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

View File

@ -18,3 +18,6 @@ deprecated = true
[5]
requirements = ansible>=5.0,<6.0
[6]
requirements = ansible>=6.0,<7.0