From 225130a594e84776b3bfcc852da37cbaeb867c42 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Fri, 6 Dec 2019 17:29:45 +0100 Subject: [PATCH] Use {{ openstack_branch }} as version of kolla-ansible in ansible tests Instead of always checking out the master branch, use the kolla-ansible branch with which this Kayobe version is meant to be used. Change-Id: I074d4b9d444649ecf956d3cd92748862e8c89a5c --- ansible/roles/kolla-ansible/tests/test-defaults.yml | 2 +- ansible/roles/kolla-ansible/tests/test-extras.yml | 2 +- ansible/roles/kolla-ansible/tests/test-requirements.yml | 2 +- tools/test-ansible.sh | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ansible/roles/kolla-ansible/tests/test-defaults.yml b/ansible/roles/kolla-ansible/tests/test-defaults.yml index 1c51780fe..8aa7a1779 100644 --- a/ansible/roles/kolla-ansible/tests/test-defaults.yml +++ b/ansible/roles/kolla-ansible/tests/test-defaults.yml @@ -15,7 +15,7 @@ kolla_ansible_source_path: "{{ temp_path }}/src" kolla_ansible_ctl_install_type: "source" kolla_ansible_source_url: "http://github.com/openstack/kolla-ansible" - kolla_ansible_source_version: "master" + kolla_ansible_source_version: "{{ openstack_branch }}" kolla_ansible_venv: "{{ temp_path }}/venv" kolla_config_path: "{{ temp_path }}/etc/kolla" kolla_node_custom_config_path: "{{ temp_path }}/etc/kolla/config" diff --git a/ansible/roles/kolla-ansible/tests/test-extras.yml b/ansible/roles/kolla-ansible/tests/test-extras.yml index ad4c40c30..286929e88 100644 --- a/ansible/roles/kolla-ansible/tests/test-extras.yml +++ b/ansible/roles/kolla-ansible/tests/test-extras.yml @@ -57,7 +57,7 @@ kolla_ansible_source_path: "{{ temp_path }}/src" kolla_ansible_ctl_install_type: "source" kolla_ansible_source_url: "http://github.com/openstack/kolla-ansible" - kolla_ansible_source_version: "master" + kolla_ansible_source_version: "{{ openstack_branch }}" kolla_ansible_venv: "{{ temp_path }}/venv" kolla_ansible_vault_password: "fake-password" kolla_config_path: "{{ temp_path }}/etc/kolla" diff --git a/ansible/roles/kolla-ansible/tests/test-requirements.yml b/ansible/roles/kolla-ansible/tests/test-requirements.yml index a6063a07d..5e1e89e1e 100644 --- a/ansible/roles/kolla-ansible/tests/test-requirements.yml +++ b/ansible/roles/kolla-ansible/tests/test-requirements.yml @@ -15,7 +15,7 @@ kolla_ansible_source_path: "{{ temp_path }}/src" kolla_ansible_ctl_install_type: "source" kolla_ansible_source_url: "http://github.com/openstack/kolla-ansible" - kolla_ansible_source_version: "master" + kolla_ansible_source_version: "{{ openstack_branch }}" kolla_ansible_venv: "{{ temp_path }}/venv" kolla_ansible_venv_extra_requirements: - "hvac" diff --git a/tools/test-ansible.sh b/tools/test-ansible.sh index e54dc56fc..93acd43e4 100755 --- a/tools/test-ansible.sh +++ b/tools/test-ansible.sh @@ -7,7 +7,11 @@ set -e failed=0 for playbook in ansible/roles/*/tests/main.yml; do - if ! ansible-playbook --connection=local $playbook $*; then + # We declare extra variables to install the {{ openstack_branch }} version + # of kolla-ansible. We should use {{ kolla_ansible_source_version }}, but + # adding ansible/group_vars/all/kolla would in turn require other + # extra-vars files (like pip) and may cause unintended side effects. + if ! ansible-playbook --connection=local $playbook $* -e @ansible/group_vars/all/openstack; then failed=$((failed + 1)) fi done