Bump Ansible versions to 2.16 and 2.17

Change-Id: Ic87fb3e4c014d3090869d5631e02982829df6312
This commit is contained in:
Michal Nasiadka 2024-06-11 11:53:17 +02:00
parent b9af83bb68
commit 1d3b4f7b2d
7 changed files with 53 additions and 28 deletions

View File

@ -1,8 +1,8 @@
--- ---
docker_version_min: '18.09' docker_version_min: '18.09'
docker_py_version_min: '3.4.1' docker_py_version_min: '3.4.1'
ansible_version_min: '2.15' ansible_version_min: '2.16'
ansible_version_max: '2.16' ansible_version_max: '2.17'
# Top level keys should match ansible_facts.distribution. # Top level keys should match ansible_facts.distribution.
# These map to lists of supported releases (ansible_facts.distribution_release) or # These map to lists of supported releases (ansible_facts.distribution_release) or

View File

@ -130,10 +130,10 @@ else:
TESTED_RUNTIMES_GOVERNANCE_URL =\ TESTED_RUNTIMES_GOVERNANCE_URL =\
'https://governance.openstack.org/tc/reference/runtimes/{}.html'.format(KOLLA_OPENSTACK_RELEASE) 'https://governance.openstack.org/tc/reference/runtimes/{}.html'.format(KOLLA_OPENSTACK_RELEASE)
ANSIBLE_CORE_VERSION_MIN = '2.15' ANSIBLE_CORE_VERSION_MIN = '2.16'
ANSIBLE_CORE_VERSION_MAX = '2.16' ANSIBLE_CORE_VERSION_MAX = '2.17'
ANSIBLE_VERSION_MIN = '8' ANSIBLE_VERSION_MIN = '9'
ANSIBLE_VERSION_MAX = '9' ANSIBLE_VERSION_MAX = '10'
GLOBAL_VARIABLE_MAP = { GLOBAL_VARIABLE_MAP = {
'|ANSIBLE_CORE_VERSION_MIN|': ANSIBLE_CORE_VERSION_MIN, '|ANSIBLE_CORE_VERSION_MIN|': ANSIBLE_CORE_VERSION_MIN,

View File

@ -6,6 +6,7 @@
- name: Set facts for commonly used variables - name: Set facts for commonly used variables
set_fact: set_fact:
kolla_ansible_src_dir: "{{ ansible_env.PWD }}/src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible" kolla_ansible_src_dir: "{{ ansible_env.PWD }}/src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible"
kolla_ansible_venv_path: "{{ ansible_env.HOME }}/kolla-ansible-venv"
upper_constraints_file: "{{ ansible_env.HOME }}/src/opendev.org/openstack/requirements/upper-constraints.txt" upper_constraints_file: "{{ ansible_env.HOME }}/src/opendev.org/openstack/requirements/upper-constraints.txt"
pip_user_path_env: pip_user_path_env:
PATH: "{{ ansible_env.HOME + '/.local/bin:' + ansible_env.PATH }}" PATH: "{{ ansible_env.HOME + '/.local/bin:' + ansible_env.PATH }}"
@ -21,27 +22,40 @@
mode: 0777 mode: 0777
become: true become: true
- name: Ensure python3-pip exists - name: Install Python3.12 on RHEL derivatives
package: dnf:
name: python3-pip name:
- python3.12
- python3.12-devel
state: latest
when: ansible_facts.os_family == 'RedHat'
become: true become: true
# NOTE(mgoddard): We need a recent pip to install the latest cryptography - name: Create Kolla Ansible venv
# library. See https://github.com/pyca/cryptography/issues/5753 command:
- name: Install pip 19.1.1+ cmd: "{{ 'python3.12' if ansible_facts.os_family == 'RedHat' else 'python3' }} -m venv {{ kolla_ansible_venv_path }}"
creates: "{{ kolla_ansible_venv_path }}"
- name: Ensure the latest tested pip
pip: pip:
name: "pip>=19.1.1" name: "pip==23.*"
executable: "pip3" state: latest
extra_args: "--user" virtualenv: "{{ kolla_ansible_venv_path }}"
- name: Ensure the latest tested setuptools
pip:
name: "setuptools==67.2.0"
state: latest
virtualenv: "{{ kolla_ansible_venv_path }}"
- name: Install kolla-ansible and dependencies - name: Install kolla-ansible and dependencies
pip: pip:
executable: "pip3" extra_args: "-c {{ upper_constraints_file }}"
extra_args: "-c {{ upper_constraints_file }} --user"
name: name:
- "{{ kolla_ansible_src_dir }}" - "{{ kolla_ansible_src_dir }}"
- "ansible-core{{ ansible_core_version_constraint }}" - "ansible-core{{ ansible_core_version_constraint }}"
- "ansible{{ ansible_version_constraint }}" - "ara[server]<1.7"
virtualenv: "{{ kolla_ansible_venv_path }}"
- name: Copy passwords.yml file - name: Copy passwords.yml file
copy: copy:
@ -51,7 +65,7 @@
remote_src: true remote_src: true
- name: Generate passwords - name: Generate passwords
command: kolla-genpwd command: "{{ kolla_ansible_venv_path }}/bin/kolla-genpwd"
# At this point we have generated all necessary configuration, and are # At this point we have generated all necessary configuration, and are
# ready to test Hashicorp Vault. # ready to test Hashicorp Vault.
@ -62,6 +76,7 @@
chdir: "{{ kolla_ansible_src_dir }}" chdir: "{{ kolla_ansible_src_dir }}"
environment: environment:
BASE_DISTRO: "{{ base_distro }}" BASE_DISTRO: "{{ base_distro }}"
KOLLA_ANSIBLE_VENV_PATH: "{{ kolla_ansible_venv_path }}"
- name: Read template file - name: Read template file
slurp: slurp:

View File

@ -243,9 +243,18 @@
state: directory state: directory
become: true become: true
- name: Install Python3.12 on RHEL derivatives
dnf:
name:
- python3.12
- python3.12-devel
state: latest
when: ansible_facts.os_family == 'RedHat'
become: true
- name: Create Kolla Ansible venv - name: Create Kolla Ansible venv
command: command:
cmd: "python3 -m venv {{ kolla_ansible_venv_path }}" cmd: "{{ 'python3.12' if ansible_facts.os_family == 'RedHat' else 'python3' }} -m venv {{ kolla_ansible_venv_path }}"
creates: "{{ kolla_ansible_venv_path }}" creates: "{{ kolla_ansible_venv_path }}"
- name: Ensure the latest tested pip - name: Ensure the latest tested pip

View File

@ -54,6 +54,7 @@ function teardown {
function test_hashicorp_vault_passwords { function test_hashicorp_vault_passwords {
echo "Setting up development Vault server..." echo "Setting up development Vault server..."
source $KOLLA_ANSIBLE_VENV_PATH/bin/activate
install_vault install_vault
start_vault start_vault
test_vault test_vault

View File

@ -7,8 +7,8 @@ set -o errexit
# do not use _PYTHON_BIN directly, use $(get_python_bin) instead # do not use _PYTHON_BIN directly, use $(get_python_bin) instead
_PYTHON_BIN="" _PYTHON_BIN=""
ANSIBLE_VERSION_MIN=2.15 ANSIBLE_VERSION_MIN=2.16
ANSIBLE_VERSION_MAX=2.16 ANSIBLE_VERSION_MAX=2.17
function get_python_bin { function get_python_bin {
if [ -n "$_PYTHON_BIN" ]; then if [ -n "$_PYTHON_BIN" ]; then

View File

@ -7,17 +7,17 @@
# Use SLURP version (two releases back) on SLURP upgrades. # Use SLURP version (two releases back) on SLURP upgrades.
ansible_core_version_constraint: >- ansible_core_version_constraint: >-
{{ ansible_core_version_slurp if is_slurp else ansible_core_version_min if is_upgrade or ansible_facts.distribution != "Ubuntu" else ansible_core_version_max }} {{ ansible_core_version_slurp if is_slurp else ansible_core_version_min if is_upgrade or ansible_facts.distribution != "Ubuntu" else ansible_core_version_max }}
ansible_core_version_slurp: "==2.14.*" ansible_core_version_slurp: "==2.16.*"
ansible_core_version_max: "==2.16.*" ansible_core_version_max: "==2.17.*"
ansible_core_version_min: "==2.15.*" ansible_core_version_min: "==2.16.*"
# Test latest ansible-core version on Ubuntu, minimum supported on others. # Test latest ansible-core version on Ubuntu, minimum supported on others.
# Use SLURP version (two releases back) on SLURP upgrades. # Use SLURP version (two releases back) on SLURP upgrades.
# TODO(mnasiadka): Remove in D. # TODO(mnasiadka): Remove in D.
ansible_version_constraint: >- ansible_version_constraint: >-
{{ ansible_version_slurp if is_slurp else ansible_version_min if is_upgrade or ansible_facts.distribution != "Ubuntu" else ansible_version_max }} {{ ansible_version_slurp if is_slurp else ansible_version_min if is_upgrade or ansible_facts.distribution != "Ubuntu" else ansible_version_max }}
ansible_version_slurp: "==7.*" ansible_version_slurp: "==9.*"
ansible_version_min: "==8.*" ansible_version_min: "==9.*"
ansible_version_max: "==9.*" ansible_version_max: "==10.*"
# NOTE(mgoddard): Test the use of interface names with dashes. # NOTE(mgoddard): Test the use of interface names with dashes.
api_interface_name: "vxlan-0" api_interface_name: "vxlan-0"
api_network_prefix: "192.0.2." api_network_prefix: "192.0.2."