Merge "Support Ansible 2.8"

This commit is contained in:
Zuul
2019-05-16 22:04:13 +00:00
committed by Gerrit Code Review
210 changed files with 366 additions and 1 deletions
+8
View File
@@ -45,6 +45,12 @@
vars:
zuul_ansible_version: 2.7
- job:
name: zuul-stream-functional-2.8
parent: zuul-stream-functional
vars:
zuul_ansible_version: 2.8
- job:
name: zuul-tox-remote
parent: tox
@@ -188,6 +194,7 @@
- zuul-stream-functional-2.5
- zuul-stream-functional-2.6
- zuul-stream-functional-2.7
- zuul-stream-functional-2.8
- zuul-tox-remote
- zuul-quick-start:
dependencies: zuul-build-image
@@ -224,6 +231,7 @@
- zuul-stream-functional-2.5
- zuul-stream-functional-2.6
- zuul-stream-functional-2.7
- zuul-stream-functional-2.8
- zuul-tox-remote
- zuul-quick-start:
dependencies: zuul-upload-image
@@ -0,0 +1,4 @@
---
features:
- |
Zuul now supports ansible 2.8 for running jobs.
@@ -60,6 +60,14 @@
test_ansible_version_major: 2
test_ansible_version_minor: 7
- job:
name: ansible-28
parent: ansible-version
ansible-version: 2.8
vars:
test_ansible_version_major: 2
test_ansible_version_minor: 8
- project:
name: common-config
@@ -69,6 +77,7 @@
- ansible-25
- ansible-26
- ansible-27
- ansible-28
- project:
name: org/project
@@ -78,3 +87,4 @@
- ansible-25
- ansible-26
- ansible-27
- ansible-28
@@ -219,3 +219,7 @@ class TestActionModules26(TestActionModules25):
class TestActionModules27(TestActionModules25):
ansible_version = '2.7'
class TestActionModules28(TestActionModules25):
ansible_version = '2.8'
+41
View File
@@ -150,3 +150,44 @@ class TestZuulJSON26(TestZuulJSON25):
class TestZuulJSON27(TestZuulJSON25):
ansible_version = '2.7'
class TestZuulJSON28(TestZuulJSON25):
ansible_version = '2.8'
def test_json_task_action(self):
job = self._run_job('no-log')
with self.jobLog(job):
build = self.history[-1]
self.assertEqual(build.result, 'SUCCESS')
text = self._get_json_as_text(build)
json_result = json.loads(text)
tasks = json_result[0]['plays'][0]['tasks']
# NOTE(pabelanger): In 2.8 gather_facts are now logged as an
# expected action.
expected_actions = [
'gather_facts', 'debug', 'debug', 'debug', 'copy', 'find',
'stat', 'debug'
]
for i, expected in enumerate(expected_actions):
host_result = tasks[i]['hosts']['controller']
self.assertEquals(expected, host_result['action'])
def test_json_role_log(self):
job = self._run_job('json-role')
with self.jobLog(job):
build = self.history[-1]
self.assertEqual(build.result, 'SUCCESS')
text = self._get_json_as_text(build)
self.assertIn('json-role', text)
json_result = json.loads(text)
# NOTE(pabelanger): In 2.8 gather_facts are now logged as the
# first task.
role_name = json_result[0]['plays'][0]['tasks'][1]['role']['name']
self.assertEqual('json-role', role_name)
role_path = json_result[0]['plays'][0]['tasks'][1]['role']['path']
self.assertEqual('json-role', os.path.basename(role_path))
+77
View File
@@ -192,3 +192,80 @@ class TestZuulStream26(TestZuulStream25):
class TestZuulStream27(TestZuulStream25):
ansible_version = '2.7'
class TestZuulStream28(TestZuulStream25):
ansible_version = '2.8'
def test_command(self):
job = self._run_job('command')
with self.jobLog(job):
build = self.history[-1]
self.assertEqual(build.result, 'SUCCESS')
text = self._get_job_output(build)
self.assertLogLine(
r'RUN START: \[untrusted : review.example.com/org/project/'
r'playbooks/command.yaml@master\]', text)
self.assertLogLine(r'PLAY \[all\]', text)
self.assertLogLine(
r'Ansible version={}'.format(self.ansible_version), text)
self.assertLogLine(r'TASK \[Show contents of first file\]', text)
self.assertLogLine(r'controller \| command test one', text)
self.assertLogLine(
r'controller \| ok: Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text)
self.assertLogLine(r'TASK \[Show contents of second file\]', text)
self.assertLogLine(r'compute1 \| command test two', text)
self.assertLogLine(r'controller \| command test two', text)
self.assertLogLine(r'compute1 \| This is a rescue task', text)
self.assertLogLine(r'controller \| This is a rescue task', text)
self.assertLogLine(r'compute1 \| This is an always task', text)
self.assertLogLine(r'controller \| This is an always task', text)
self.assertLogLine(r'compute1 \| This is a handler', text)
self.assertLogLine(r'controller \| This is a handler', text)
self.assertLogLine(r'controller \| First free task', text)
self.assertLogLine(r'controller \| Second free task', text)
self.assertLogLine(r'controller \| This is a shell task after an '
'included role', text)
self.assertLogLine(r'compute1 \| This is a shell task after an '
'included role', text)
self.assertLogLine(r'controller \| This is a command task after '
'an included role', text)
self.assertLogLine(r'compute1 \| This is a command task after an '
'included role', text)
self.assertLogLine(r'controller \| This is a shell task with '
'delegate compute1', text)
self.assertLogLine(r'controller \| This is a shell task with '
'delegate controller', text)
self.assertLogLine(r'compute1 \| item_in_loop1', text)
self.assertLogLine(r'compute1 \| ok: Item: item_in_loop1 '
r'Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text)
self.assertLogLine(r'compute1 \| item_in_loop2', text)
self.assertLogLine(r'compute1 \| ok: Item: item_in_loop2 '
r'Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text)
self.assertLogLine(r'compute1 \| failed_in_loop1', text)
self.assertLogLine(r'compute1 \| ok: Item: failed_in_loop1 '
r'Result: 1', text)
self.assertLogLine(r'compute1 \| failed_in_loop2', text)
self.assertLogLine(r'compute1 \| ok: Item: failed_in_loop2 '
r'Result: 1', text)
self.assertLogLine(r'localhost \| .*No such file or directory: .*'
r'\'/local-shelltask/somewhere/'
r'that/does/not/exist\'', text)
self.assertLogLine(r'compute1 \| .*No such file or directory: .*'
r'\'/remote-shelltask/somewhere/'
r'that/does/not/exist\'', text)
self.assertLogLine(r'controller \| .*No such file or directory: .*'
r'\'/remote-shelltask/somewhere/'
r'that/does/not/exist\'', text)
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)
self.assertLogLine(
r'RUN END RESULT_NORMAL: \[untrusted : review.example.com/'
r'org/project/playbooks/command.yaml@master]', text)
+6
View File
@@ -2730,6 +2730,10 @@ class TestAnsible27(TestAnsible25):
ansible_version = '2.7'
class TestAnsible28(TestAnsible25):
ansible_version = '2.8'
class TestPrePlaybooks(AnsibleZuulTestCase):
# A temporary class to hold new tests while others are disabled
@@ -6051,6 +6055,7 @@ class TestAnsibleVersion(AnsibleZuulTestCase):
dict(name='ansible-25', result='SUCCESS', changes='1,1'),
dict(name='ansible-26', result='SUCCESS', changes='1,1'),
dict(name='ansible-27', result='SUCCESS', changes='1,1'),
dict(name='ansible-28', result='SUCCESS', changes='1,1'),
], ordered=False)
@@ -6072,4 +6077,5 @@ class TestDefaultAnsibleVersion(AnsibleZuulTestCase):
dict(name='ansible-25', result='SUCCESS', changes='1,1'),
dict(name='ansible-26', result='SUCCESS', changes='1,1'),
dict(name='ansible-27', result='SUCCESS', changes='1,1'),
dict(name='ansible-28', result='SUCCESS', changes='1,1'),
], ordered=False)
+1
View File
@@ -0,0 +1 @@
../../base/action/__init__.py
+1
View File
@@ -0,0 +1 @@
../../base/action/add_host.py
+1
View File
@@ -0,0 +1 @@
../../base/action/add_host.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/aireos.py
+1
View File
@@ -0,0 +1 @@
../../base/action/aireos.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/aireos_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/aireos_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/aruba.py
+1
View File
@@ -0,0 +1 @@
../../base/action/aruba.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/aruba_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/aruba_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/asa.py
+1
View File
@@ -0,0 +1 @@
../../base/action/asa.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/asa_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/asa_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/asa_template.py
+1
View File
@@ -0,0 +1 @@
../../base/action/asa_template.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/assemble.py
+1
View File
@@ -0,0 +1 @@
../../base/action/assemble.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/aws_s3.py
+1
View File
@@ -0,0 +1 @@
../../base/action/aws_s3.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/ce.py
+1
View File
@@ -0,0 +1 @@
../../base/action/ce.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/ce_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/ce_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/ce_template.py
+1
View File
@@ -0,0 +1 @@
../../base/action/ce_template.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/copy.py
+1
View File
@@ -0,0 +1 @@
../../base/action/copy.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/dellos10_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/dellos10_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/dellos6_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/dellos6_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/dellos9_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/dellos9_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/eos_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/eos_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/eos_template.py
+1
View File
@@ -0,0 +1 @@
../../base/action/eos_template.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/fetch.py
+1
View File
@@ -0,0 +1 @@
../../base/action/fetch.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/fortios_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/fortios_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/include_vars.py
+1
View File
@@ -0,0 +1 @@
../../base/action/include_vars.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/ios_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/ios_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/ios_template.py
+1
View File
@@ -0,0 +1 @@
../../base/action/ios_template.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/iosxr_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/iosxr_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/iosxr_template.py
+1
View File
@@ -0,0 +1 @@
../../base/action/iosxr_template.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/junos_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/junos_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/junos_template.py
+1
View File
@@ -0,0 +1 @@
../../base/action/junos_template.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_banner.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_banner.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_base.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_base.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_config.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_config.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_get.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_get.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_interface.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_interface.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_l2_interface.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_l2_interface.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_l3_interface.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_l3_interface.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_linkagg.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_linkagg.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_lldp.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_lldp.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_lldp_interface.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_lldp_interface.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_logging.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_logging.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_ping.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_ping.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_static_route.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_static_route.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_system.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_system.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_template.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_template.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_user.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_user.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_vlan.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_vlan.pyi
+1
View File
@@ -0,0 +1 @@
../../base/action/net_vrf.py
+1
View File
@@ -0,0 +1 @@
../../base/action/net_vrf.pyi

Some files were not shown because too many files have changed in this diff Show More