Merge "Pin bridge.o.o to ansible 2.7.0, add devel testing job"

This commit is contained in:
Zuul 2018-11-09 02:51:20 +00:00 committed by Gerrit Code Review
commit 04d00ae988
4 changed files with 62 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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