Fix ignored default ansible version
The default ansible version which can be defined in zuul.conf has been ignored because wrong Instanciation of the AnsibleManager. While at it also add a release note for the broken uri module fix. Change-Id: Ia73250b7c9d6d32cdc7a9ac3a89279a1ab4efd71
This commit is contained in:
parent
efae4deec5
commit
d283700b5d
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
When using Ansible 2.7 the uri module crashed with a module failure.
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
The :attr:`scheduler.default_ansible_version` has been ignored.
|
|
@ -27,6 +27,15 @@
|
||||||
test_ansible_version_major: 2
|
test_ansible_version_major: 2
|
||||||
test_ansible_version_minor: 7
|
test_ansible_version_minor: 7
|
||||||
|
|
||||||
|
# This job is used by a test case specifying a different ansible version in
|
||||||
|
# zuul.conf
|
||||||
|
- job:
|
||||||
|
name: ansible-default-zuul-conf
|
||||||
|
parent: ansible-version
|
||||||
|
vars:
|
||||||
|
test_ansible_version_major: 2
|
||||||
|
test_ansible_version_minor: 6
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ansible-25
|
name: ansible-25
|
||||||
parent: ansible-version
|
parent: ansible-version
|
||||||
|
@ -60,3 +69,12 @@
|
||||||
- ansible-25
|
- ansible-25
|
||||||
- ansible-26
|
- ansible-26
|
||||||
- ansible-27
|
- ansible-27
|
||||||
|
|
||||||
|
- project:
|
||||||
|
name: org/project
|
||||||
|
check:
|
||||||
|
jobs:
|
||||||
|
- ansible-default-zuul-conf
|
||||||
|
- ansible-25
|
||||||
|
- ansible-26
|
||||||
|
- ansible-27
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
test
|
|
@ -4,3 +4,5 @@
|
||||||
gerrit:
|
gerrit:
|
||||||
config-projects:
|
config-projects:
|
||||||
- common-config
|
- common-config
|
||||||
|
untrusted-projects:
|
||||||
|
- org/project
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
[gearman]
|
||||||
|
server=127.0.0.1
|
||||||
|
|
||||||
|
[statsd]
|
||||||
|
# note, use 127.0.0.1 rather than localhost to avoid getting ipv6
|
||||||
|
# see: https://github.com/jsocol/pystatsd/issues/61
|
||||||
|
server=127.0.0.1
|
||||||
|
|
||||||
|
[scheduler]
|
||||||
|
tenant_config=main.yaml
|
||||||
|
relative_priority=true
|
||||||
|
default_ansible_version=2.6
|
||||||
|
|
||||||
|
[merger]
|
||||||
|
git_dir=/tmp/zuul-test/merger-git
|
||||||
|
git_user_email=zuul@example.com
|
||||||
|
git_user_name=zuul
|
||||||
|
|
||||||
|
[executor]
|
||||||
|
git_dir=/tmp/zuul-test/executor-git
|
||||||
|
|
||||||
|
[connection gerrit]
|
||||||
|
driver=gerrit
|
||||||
|
server=review.example.com
|
||||||
|
user=jenkins
|
||||||
|
sshkey=fake_id_rsa_path
|
||||||
|
|
||||||
|
[connection smtp]
|
||||||
|
driver=smtp
|
||||||
|
server=localhost
|
||||||
|
port=25
|
||||||
|
default_from=zuul@example.com
|
||||||
|
default_to=you@example.com
|
||||||
|
|
||||||
|
[web]
|
||||||
|
static_cache_expiry=1200
|
|
@ -5534,3 +5534,24 @@ class TestAnsibleVersion(AnsibleZuulTestCase):
|
||||||
dict(name='ansible-26', 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-27', result='SUCCESS', changes='1,1'),
|
||||||
], ordered=False)
|
], ordered=False)
|
||||||
|
|
||||||
|
|
||||||
|
class TestDefaultAnsibleVersion(AnsibleZuulTestCase):
|
||||||
|
config_file = 'zuul-default-ansible-version.conf'
|
||||||
|
tenant_config_file = 'config/ansible-versions/main.yaml'
|
||||||
|
|
||||||
|
def test_ansible_versions(self):
|
||||||
|
"""
|
||||||
|
Tests that jobs run with the requested ansible version.
|
||||||
|
"""
|
||||||
|
A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A')
|
||||||
|
self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))
|
||||||
|
self.waitUntilSettled()
|
||||||
|
|
||||||
|
self.assertHistory([
|
||||||
|
dict(name='ansible-default-zuul-conf', result='SUCCESS',
|
||||||
|
changes='1,1'),
|
||||||
|
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'),
|
||||||
|
], ordered=False)
|
||||||
|
|
|
@ -326,7 +326,8 @@ class Scheduler(threading.Thread):
|
||||||
|
|
||||||
default_ansible_version = get_default(
|
default_ansible_version = get_default(
|
||||||
self.config, 'scheduler', 'default_ansible_version', None)
|
self.config, 'scheduler', 'default_ansible_version', None)
|
||||||
self.ansible_manager = AnsibleManager(default_ansible_version)
|
self.ansible_manager = AnsibleManager(
|
||||||
|
default_version=default_ansible_version)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
super(Scheduler, self).start()
|
super(Scheduler, self).start()
|
||||||
|
@ -673,7 +674,8 @@ class Scheduler(threading.Thread):
|
||||||
# changed.
|
# changed.
|
||||||
default_ansible_version = get_default(
|
default_ansible_version = get_default(
|
||||||
self.config, 'scheduler', 'default_ansible_version', None)
|
self.config, 'scheduler', 'default_ansible_version', None)
|
||||||
self.ansible_manager = AnsibleManager(default_ansible_version)
|
self.ansible_manager = AnsibleManager(
|
||||||
|
default_version=default_ansible_version)
|
||||||
|
|
||||||
for connection in self.connections.connections.values():
|
for connection in self.connections.connections.values():
|
||||||
self.log.debug("Clear branch cache for: %s" % connection)
|
self.log.debug("Clear branch cache for: %s" % connection)
|
||||||
|
|
Loading…
Reference in New Issue