Change I4789fe99651597b073e35066ec3be312e18659b8 made me realise that with the extant code, nothing will update the /usr/ansible-env environment when we bump the versions. The installation of the Ansible, openstacksdk and ARA packages as part of the "install-ansible" role was done this way to facilitate being able to install all three of these from their main/master/devel branches for the "-devel" job, which is our basic canary for upstream things that might affect us. Because of the way the pip: role works with "state: latest" and mixing on-disk paths with pypi package names, this became a bit of a complex swizzling operation. Some thing have changed since then; particularly us now using a separate venv and upstream Ansible's change to use "collections"; so pulling in a bug-fix for Ansible is not as simple as just cloning github.com/ansible/ansible at a particular tag any more. This means we should reconsider how we're specifying the packages here. This simplifies things to list the required packages in a requirements.txt file, which we install into the venv root. The nice thing about this is that creating requirements.txt with the template: role is idempotent, so we can essentially monitor the file for changes and only (re-)run the pip install into /usr/ansible-env when we change versions (forcing upgrades so we get the versions we want, and fixing the original issue mentioned above). Change-Id: I3696740112fa691d1700040b557f53f6721393e7changes/42/866542/10
parent
42581d6462
commit
e182394e97
@ -1,33 +0,0 @@
|
||||
# If ansible_install_ansible_ara_version is not defined it should be "latest"
|
||||
- name: Set ara default version to latest
|
||||
set_fact:
|
||||
install_ansible_ara_version: latest
|
||||
when: install_ansible_ara_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_ara_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 ARA version for installation
|
||||
set_fact:
|
||||
_install_ansible_ara_version: '{{ install_ansible_ara_version }}'
|
||||
when: install_ansible_ara_version not in ('', 'latest')
|
||||
|
||||
- name: Set ARA package state for installation
|
||||
set_fact:
|
||||
_install_ansible_ara_state: latest
|
||||
when: install_ansible_ara_version == 'latest'
|
||||
|
||||
- name: Install ARA
|
||||
pip:
|
||||
name: '{{ install_ansible_ara_name | default("ara[server]") }}'
|
||||
version: '{{ _install_ansible_ara_version | default(omit) }}'
|
||||
state: '{{ _install_ansible_ara_state | default(omit) }}'
|
||||
virtualenv: '/usr/ansible-venv'
|
||||
|
||||
# For configuring the callback plugins location in ansible.cfg
|
||||
- name: Get ARA's location for callback plugins
|
||||
command: /usr/ansible-venv/bin/python3 -m ara.setup.callback_plugins
|
||||
register: install_ansible_ara_callback_plugins
|
||||
changed_when: false
|
@ -0,0 +1,3 @@
|
||||
{% for r in install_ansible_requirements %}
|
||||
{{ r }}
|
||||
{% endfor %}
|
Loading…
Reference in new issue