Get rid of ci_testing variable in roles

The roles should not change their behavior based on the presence of Zuul.
Use the existing copy_from_local_path variable to copy pre-cached
repositories. Also get rid of the redundant ci_testing_zuul.

Change-Id: Idfdfe2087b020cd8069d1088991e088873783825
This commit is contained in:
Dmitry Tantsur 2020-07-09 12:06:30 +02:00
parent 9b1d1d591e
commit ab69cca0ce
9 changed files with 22 additions and 27 deletions

View File

@ -52,4 +52,3 @@ force_update_repos: true
# Conditional variables utilized based on CI or manual testing options.
copy_from_local_path: false
ci_testing_zuul: false

View File

@ -77,13 +77,6 @@
vars:
ansible_python_interpreter: '/usr/bin/python3'
- name: "Set ci_testing_zuul if it appears we are running in upstream OpenStack CI"
set_fact:
ci_testing: true
ci_testing_zuul: true
reqs_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/requirements"
when: lookup('env', 'ZUUL_BRANCH') | length > 0
- name: ensure installation root folder exists
become: yes
file:
@ -100,11 +93,11 @@
version: "{{ reqs_git_branch }}"
update: "{{ update_repos | bool }}"
clone: yes
when: ci_testing_zuul | bool == false and copy_from_local_path | bool == false
when: copy_from_local_path | bool == false
- name: copy requirements from local path
command: cp -a {{ reqs_git_url }} {{ reqs_git_folder }} creates={{ reqs_git_folder }}
when: ci_testing_zuul | bool == true or copy_from_local_path | bool == true
when: copy_from_local_path | bool
- include: prepare_libvirt.yml

View File

@ -27,7 +27,6 @@ transform_boot_image: false
# If testing is true, then the environment is setup for using libvirt
# virtual machines for the hardware instead of real hardware.
testing: false
ci_testing: false
# Use Rabbit MQ as a message bus.
use_rabbitmq: false

View File

@ -80,11 +80,6 @@ copy_from_local_path: Boolean value, defaults to false. If set to true,
pre-existing repository state. This is largely
something that is needed in CI testing if dependent
changes are pre-staged in the local repositories.
ci_testing_zuul: Boolean value, default false. This value is utilized
to tell the preparatory playbook when the prep role
is running in a CI system with Zuul, which in such
cases the repositories must be copied, not overwritten.
Dependencies
------------

View File

@ -55,7 +55,6 @@ force_update_repos: true
# Conditional variables utilized based on CI or manual testing options.
copy_from_local_path: false
ci_testing_zuul: false
bifrost_install_sources:
- git_folder: "{{ ironic_git_folder }}"

View File

@ -30,9 +30,9 @@
update: "{{ update_repos | bool }}"
clone: yes
loop: "{{ bifrost_install_sources }}"
when: ci_testing_zuul | bool == false and copy_from_local_path | bool == false and item.source_install | default(true) | bool
when: copy_from_local_path | bool == false and item.source_install | default(true) | bool
- name: "Copy from local path"
command: cp -a {{ item.git_url }} {{ item.git_folder }} creates={{ item.git_folder }}
loop: "{{ bifrost_install_sources }}"
when: (ci_testing_zuul | bool == true or copy_from_local_path | bool == true) and item.source_install | default(true) | bool
when: copy_from_local_path | bool == true and item.source_install | default(true) | bool

View File

@ -24,13 +24,14 @@
- name: "Set ci_testing flag if running in the CI"
set_fact:
ci_testing: true
ci_testing_zuul: true
copy_from_local_path: true
reqs_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/requirements"
when: lookup('env', 'ZUUL_BRANCH') | length > 0
- name: "Collect process list if running in OpenStack CI"
command: ps aux
when: ci_testing_zuul is defined
when: ci_testing | default(false)| bool
- name: "Collect list of listening network sockets if running in OpenStack CI"
shell: netstat -apn|grep LISTEN
when: ci_testing_zuul is defined
when: ci_testing | default(false)| bool
roles:
- role: bifrost-create-vm-nodes

View File

@ -12,10 +12,10 @@
become: no
gather_facts: yes
pre_tasks:
- name: "Set ci_testing_zuul if it appears we are running in upstream OpenStack CI"
- name: "Set ci_testing and other variables if it appears we are running in upstream OpenStack CI"
set_fact:
ci_testing: true
ci_testing_zuul: true
copy_from_local_path: true
ironic_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/ironic"
ironicclient_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/python-ironicclient"
openstacksdk_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/openstacksdk"
@ -46,14 +46,14 @@
pre_tasks:
- name: "Collect process list if running in a CI System"
command: ps aux
when: ci_testing is defined
when: ci_testing | default(false)| bool
- name: "Collect list of listening network sockets if running in a CI system"
shell: netstat -apn|grep LISTEN
when: ci_testing is defined
when: ci_testing | default(false)| bool
- name: "Use a cached cirros image"
set_fact:
cirros_deploy_image_upstream_url: file:///opt/cache/files/cirros-0.4.0-x86_64-disk.img
when: ci_testing is defined and ci_testing_zuul is defined and ci_testing_zuul | bool
when: ci_testing | default(false)| bool
roles:
- role: bifrost-keystone-install
- role: bifrost-ironic-install

View File

@ -0,0 +1,9 @@
---
upgrade:
- |
The variable ``ci_testing`` is no longer taken into account by the roles.
Use the existing ``copy_from_local_path`` if you need Bifrost to copy
repositories from their pre-cached locations.
other:
- |
The variable ``ci_testing_zuul`` is no longer used or set.