From 1375517d2b39ecbba539d05749cc01bf8d1114bf Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 29 Mar 2022 11:30:45 +0100 Subject: [PATCH] Adds kolla_ansible_venv_ansible This adds a variable that allows you to modify the version of ansible installed in the kolla-ansible virtualenv. This is useful if you want to use a customised version of ansible. Change-Id: I319dd51ed3221826f820fbc0ae3639b89e9c82ea --- ansible/roles/kolla-ansible/defaults/main.yml | 5 +++++ ansible/roles/kolla-ansible/tasks/install.yml | 5 +---- etc/kayobe/kolla.yml | 5 +++++ ...adds-ansible-requirement-specifier-728e3045fc448715.yaml | 6 ++++++ 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/adds-ansible-requirement-specifier-728e3045fc448715.yaml diff --git a/ansible/roles/kolla-ansible/defaults/main.yml b/ansible/roles/kolla-ansible/defaults/main.yml index 8a3ff899e..e824f4175 100644 --- a/ansible/roles/kolla-ansible/defaults/main.yml +++ b/ansible/roles/kolla-ansible/defaults/main.yml @@ -21,6 +21,11 @@ kolla_ansible_venv_python: python3 # Extra requirements to install inside the kolla-ansible virtualenv. kolla_ansible_venv_extra_requirements: [] +# Pip requirement specifier for the ansible package. NOTE: This limits the +# version of ansible used by kolla-ansible to avoid new releases from breaking +# tested code. Changes to this limit should be tested. +kolla_ansible_venv_ansible: 'ansible>=4,<6.0' + # Path to a requirements.yml file for Ansible collections. kolla_ansible_requirements_yml: "{{ kolla_ansible_venv }}/share/kolla-ansible/requirements.yml" diff --git a/ansible/roles/kolla-ansible/tasks/install.yml b/ansible/roles/kolla-ansible/tasks/install.yml index bf1728214..7d93a4ba1 100644 --- a/ansible/roles/kolla-ansible/tasks/install.yml +++ b/ansible/roles/kolla-ansible/tasks/install.yml @@ -95,10 +95,7 @@ {% else %} kolla-ansible=={{ kolla_openstack_release }} {% endif %} - # Limit the version of ansible used by kolla-ansible to avoid new - # releases from breaking tested code. Changes to this limit should be - # tested. - - ansible>=4,<6.0 + - "{{ kolla_ansible_venv_ansible }}" - selinux pip: name: "{{ (kolla_ansible_packages + kolla_ansible_venv_extra_requirements) | select | list }}" diff --git a/etc/kayobe/kolla.yml b/etc/kayobe/kolla.yml index 01d2a8da9..12d701009 100644 --- a/etc/kayobe/kolla.yml +++ b/etc/kayobe/kolla.yml @@ -50,6 +50,11 @@ # Extra requirements to install inside the kolla-ansible virtualenv. #kolla_ansible_venv_extra_requirements: +# Pip requirement specifier for the ansible package. NOTE: This limits the +# version of ansible used by kolla-ansible to avoid new releases from breaking +# tested code. Changes to this limit should be tested. +#kolla_ansible_venv_ansible: + # Path to Kolla-ansible configuration directory. Default is $KOLLA_CONFIG_PATH # or /etc/kolla if $KOLLA_CONFIG_PATH is not set. #kolla_config_path: diff --git a/releasenotes/notes/adds-ansible-requirement-specifier-728e3045fc448715.yaml b/releasenotes/notes/adds-ansible-requirement-specifier-728e3045fc448715.yaml new file mode 100644 index 000000000..d41ac7db9 --- /dev/null +++ b/releasenotes/notes/adds-ansible-requirement-specifier-728e3045fc448715.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Adds the ``kolla_ansible_venv_ansible`` configuration option. This allows + you to override the version of ansible installed in the kolla-ansible + virtualenv.