Pin bridge.o.o to ansible 2.7.0, add devel testing job
This adds arguments to "install-ansible" to allow us to specify the package name and version. This is used to pin bridge.o.o to 2.7.0 (see I9cf4baf1b15893f0c677567f5afede0d0234f0b2). A new job is added to test against the ansible-devel branch. Added as voting for now, until it proves to be a concern. Change-Id: Ic465efb637c0a1eb475f04b0b0e356d8797ecdeb
This commit is contained in:
parent
8c7e21ea9d
commit
24c81fb0c3
13
.zuul.yaml
13
.zuul.yaml
@ -157,6 +157,18 @@
|
||||
- roles/.*
|
||||
- testinfra/.*
|
||||
|
||||
- job:
|
||||
name: system-config-run-base-ansible-devel
|
||||
parent: system-config-run-base
|
||||
description: |
|
||||
Run the base playbook with the latest ansible
|
||||
required-projects:
|
||||
- name: github.com/ansible/ansible
|
||||
override-checkout: devel
|
||||
vars:
|
||||
bridge_ansible_name: '{{ ansible_user_dir}}/src/github.com/ansible/ansible'
|
||||
bridge_ansible_version: null
|
||||
|
||||
- job:
|
||||
name: system-config-run-eavesdrop
|
||||
parent: system-config-run
|
||||
@ -262,6 +274,7 @@
|
||||
- puppet-beaker-rspec-puppet-4-infra-system-config
|
||||
- puppet-beaker-rspec-puppet-4-centos-7-infra-system-config
|
||||
- system-config-run-base
|
||||
- system-config-run-base-ansible-devel
|
||||
- system-config-run-dns
|
||||
- system-config-run-eavesdrop
|
||||
- system-config-run-nodepool
|
||||
|
@ -3,7 +3,11 @@
|
||||
become: true
|
||||
roles:
|
||||
- pip3
|
||||
- install-ansible
|
||||
# Note for production use we expect to take the defaults; unit
|
||||
# test jobs override this to test with latest upstream ansible.
|
||||
- role: install-ansible
|
||||
install_ansible_name: '{{ bridge_ansible_name | default("ansible") }}'
|
||||
install_ansible_version: '{{ bridge_ansible_version | default("2.7.0") }}'
|
||||
- root-keys
|
||||
- ansible-cron
|
||||
- cloud-launcher-cron
|
||||
|
@ -2,4 +2,20 @@ Install and configure Ansible on a host via pip
|
||||
|
||||
**Role Variables**
|
||||
|
||||
* None
|
||||
.. zuul:rolevar:: install_ansible_name
|
||||
:default: ansible
|
||||
|
||||
The name of the ansible package to install. To install from
|
||||
alternative sources, this can be a URL for a remote package;
|
||||
e.g. to install from upstream devel branch
|
||||
``git+https://github.com/ansible/ansible.git@devel``
|
||||
|
||||
.. zuul:rolevar:: install_ansible_version
|
||||
:default: latest
|
||||
|
||||
The version of the library from
|
||||
:zuul:rolevar:`install-ansible.install_ansible_name`. Set this to
|
||||
empty (YAML ``null``) if specifying versions via URL in
|
||||
:zuul:rolevar:`install-ansible.install_ansible_name`. The special
|
||||
value "latest" will ensure ``state: latest`` is set for the
|
||||
package and thus the latest version is always installed.
|
||||
|
@ -1,6 +1,29 @@
|
||||
# If ansible_install_version is not defined it should be "latest"
|
||||
- name: Set ansible default version to latest
|
||||
set_fact:
|
||||
install_ansible_version: latest
|
||||
when: install_ansible_version is not defined
|
||||
|
||||
# If a version is not explicitly set we want to make sure to
|
||||
# completely omit the version argument to pip, as it will be coming
|
||||
# from the long-form install_ansible_name variable. Additionally, if
|
||||
# the version is the special value "latest", then we also want to omit
|
||||
# any version number, but also set the package state to "latest".
|
||||
- name: Set ansible version for installation
|
||||
set_fact:
|
||||
_install_ansible_version: '{{ install_ansible_version }}'
|
||||
when: install_ansible_version not in ('', 'latest')
|
||||
|
||||
- name: Set ansible package state for installation
|
||||
set_fact:
|
||||
_install_ansible_state: latest
|
||||
when: install_ansible_version == 'latest'
|
||||
|
||||
- name: Install ansible
|
||||
pip:
|
||||
name: ansible
|
||||
name: '{{ install_ansible_name | default("ansible") }}'
|
||||
version: '{{ _install_ansible_version | default(omit) }}'
|
||||
state: '{{ _install_ansible_state | default(omit) }}'
|
||||
|
||||
- name: Install openstacksdk
|
||||
pip:
|
||||
@ -56,3 +79,6 @@
|
||||
name: logrotate
|
||||
vars:
|
||||
logrotate_file_name: /var/log/ansible/ansible.log
|
||||
|
||||
- name: Verify ansible install
|
||||
command: ansible --version
|
||||
|
Loading…
Reference in New Issue
Block a user