Allow zuul pre playbook bootstrap to be skipped

This is needed if a child job in an openstack-ansible role repo
needs to do some configuration before bootstrap-ansible is run.

An example might be configuring extra roles, collections or
pythin modules to be installed during bootstrap.

Change-Id: I463cf5df7c2aa4e2cdf399efaeb17df980d29edc
This commit is contained in:
Dmitriy Rabotyagov 2024-01-11 09:25:09 +01:00 committed by Jonathan Rosser
parent 8bb7091958
commit 37e15db17f
2 changed files with 20 additions and 10 deletions

View File

@ -40,7 +40,9 @@
ZUUL_SRC_PATH: "{{ (action != 'shastest') | ternary(_zuul_src_path, '') }}"
ANSIBLE_PACKAGE: "{{ ansible_package | default('') }}"
SETUP_ARA: 'true'
when: "'upgrade' not in action"
when:
- "'upgrade' not in action"
- osa_pre_run_bootstrap | default(True)
- name: Run bootstrap-aio script
become: yes
become_user: root
@ -59,3 +61,4 @@
- "'upgrade' not in action"
- action != 'linters'
- action != 'shastest'
- osa_pre_run_bootstrap | default(True)

View File

@ -13,12 +13,19 @@
args:
chdir: "src/opendev.org/openstack/openstack-ansible"
executable: /bin/bash
environment:
# NOTE(logan): ARA is already installed in the gate environment by the
# pre-osa-aio pre-run playbook
SETUP_ARA: false
# NOTE(logan): The project is bootstrapped in the pre playbook so the
# bootstrapping can be skipped here
SKIP_OSA_RUNTIME_VENV_BUILD: 1
SKIP_OSA_BOOTSTRAP_AIO: 1
SKIP_OSA_ROLE_CLONE: 1
vars:
skip_bootstrap:
# NOTE(logan): ARA is already installed in the gate environment by the
# pre-osa-aio pre-run playbook
SETUP_ARA: False
# NOTE(logan): The project is bootstrapped in the pre playbook so the
# bootstrapping can be skipped here
SKIP_OSA_RUNTIME_VENV_BUILD: 1
SKIP_OSA_BOOTSTRAP_AIO: 1
SKIP_OSA_ROLE_CLONE: 1
run_bootstrap:
# NOTE(jrosser)
# ZUUL_SRC_PATH is needed for bootstrap-ansible inside gate-check-commit.sh
# when pre playbook bootstrap is disabled
ZUUL_SRC_PATH: "{{ ansible_user_dir }}/src"
environment: "{{ (osa_pre_run_bootstrap | default(True)) | ternary(skip_bootstrap, run_bootstrap) }}"