Make skip_install a normal boolean variable

Currently we skip installation if it's set to any value, even false.

Change-Id: I980d91302e58c086210cbcdb1e51dfcd05ec1722
This commit is contained in:
Dmitry Tantsur 2020-07-17 14:24:31 +02:00
parent 8210ff3696
commit fc2b247f64
12 changed files with 27 additions and 13 deletions

View File

@ -4,7 +4,8 @@
become: yes
gather_facts: yes
roles:
- { role: bifrost-prep-for-install, when: skip_install is not defined }
- role: bifrost-prep-for-install
when: not (skip_install | default(false) | bool)
- bifrost-keystone-install
- bifrost-ironic-install
- role: bifrost-keystone-client-config

View File

@ -31,6 +31,8 @@ ci_testing: false
# Use Rabbit MQ as a message bus.
use_rabbitmq: false
# set to true to skip installation completely
skip_install: False
# set to true to skip installing ironic dependencies
skip_package_install: False
# set to true to skip generation of configs, ironic db and rabbitmq configuration

View File

@ -127,12 +127,12 @@
mode: 0644
owner: root
group: root
when: skip_install is not defined
when: not skip_install | bool
# Note(ashestakov): "copy" module in ansible doesn't support recursive
# copying on remote host. "cp" command used instead.
- name: "Copy rootwrap.d contents from ironic source folder"
command: cp -r "{{ ironic_git_folder }}/etc/ironic/rootwrap.d/" "/etc/ironic/rootwrap.d"
when: skip_install is not defined
when: not skip_install | bool
- name: "Populate keystone for Bifrost"
include: keystone_setup.yml

View File

@ -35,7 +35,7 @@
package:
name: "{{ iscsi_required_packages }}"
state: present
when: skip_install is not defined and 'iscsi' in enabled_deploy_interfaces
when: not (skip_install | bool) and 'iscsi' in enabled_deploy_interfaces
- name: "IPA-builder - Install"
include_role:

View File

@ -4,6 +4,7 @@ keystone_source_install: true
keystone_git_url: https://opendev.org/openstack/keystone
keystone_git_folder: /opt/stack/keystone
skip_install: False
# set to true to skip installing ironic dependencies
skip_package_install: False
# set to true to skip generation of configs and ironic db configuration

View File

@ -21,7 +21,7 @@
# here for the time being.
- name: "Ensure /opt/stack is present"
file: name=/opt/stack state=directory owner=root group=root
when: skip_install is not defined
when: not skip_install | bool
- name: "Install pymysql"
include_role:

View File

@ -5,6 +5,7 @@ bifrost_venv_env:
VIRTUAL_ENV: "{{ bifrost_venv_dir }}"
PATH: "{{ bifrost_venv_dir }}/bin:{{ ansible_env.PATH }}" # include regular path via lookup env
enable_venv: true
skip_install: false
source_install: false
# Pip options

View File

@ -75,4 +75,4 @@
when: source_install | bool
environment: "{{ bifrost_venv_env if (enable_venv | bool) else {} }}"
when: skip_install | default(false) | bool == false
when: not skip_install | bool

View File

@ -99,7 +99,8 @@ Example Playbook
become: yes
gather_facts: yes
roles:
- { role: bifrost-prep-for-install, when: skip_install is not defined }
- role: bifrost-prep-for-install
when: not (skip_install | default(false) | bool)
- role: bifrost-ironic-install
cleaning: false
testing: true

View File

@ -33,7 +33,8 @@
set_fact:
ipv4_gateway: "192.168.122.1"
roles:
- { role: bifrost-prep-for-install, when: skip_install is not defined }
- role: bifrost-prep-for-install
when: not (skip_install | default(false) | bool)
environment:
http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}"

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
Previously installation used to be skipped completely if the
``skip_install`` variable is defined, independent of its value. This has
been fixed, and now installation is only skipped if ``skip_install`` is
defined and equals ``true``.

View File

@ -138,11 +138,6 @@ fi
if [ ${CLI_TEST} = "true" ]; then
# FIXME(dtantsur): bifrost-cli does not use opendev-provided repos.
../bifrost-cli --debug install --testenv
CLOUD_CONFIG+=" -e skip_install=true"
CLOUD_CONFIG+=" -e skip_package_install=true"
CLOUD_CONFIG+=" -e skip_bootstrap=true"
CLOUD_CONFIG+=" -e skip_start=true"
CLOUD_CONFIG+=" -e skip_migrations=true"
fi
set +e
@ -173,6 +168,11 @@ ${ANSIBLE} -vvvv \
-e use_public_urls=${ENABLE_KEYSTONE} \
-e wait_for_node_deploy=${WAIT_FOR_DEPLOY} \
-e not_enrolled_data_file=${BAREMETAL_DATA_FILE}.rest \
-e skip_install=${CLI_TEST} \
-e skip_package_install=${CLI_TEST} \
-e skip_bootstrap=${CLI_TEST} \
-e skip_start=${CLI_TEST} \
-e skip_migrations=${CLI_TEST} \
${CLOUD_CONFIG}
EXITCODE=$?