Test redeploy-dynamic when cirros/tinyipa are used
This is a documented feature, we need to validate it. Rename a variable to prevent it from clashing with one in the roles. Pull cloud configuration to be able to work with TLS. Change-Id: Ie41060dba2ae8c2dd88e0e6f9b574b7214302983
This commit is contained in:
parent
b72123e91b
commit
d95a1fe078
|
@ -24,6 +24,14 @@
|
||||||
name: "Collect facts"
|
name: "Collect facts"
|
||||||
become: no
|
become: no
|
||||||
gather_facts: yes
|
gather_facts: yes
|
||||||
|
|
||||||
|
- hosts: baremetal
|
||||||
|
name: "Pull cloud configuration"
|
||||||
|
become: no
|
||||||
|
connection: local
|
||||||
|
roles:
|
||||||
|
- role: bifrost-cloud-config
|
||||||
|
|
||||||
- hosts: baremetal
|
- hosts: baremetal
|
||||||
name: "Unprovision the nodes"
|
name: "Unprovision the nodes"
|
||||||
become: no
|
become: no
|
||||||
|
@ -31,29 +39,37 @@
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: "Pull initial ironic facts"
|
- name: "Pull initial ironic facts"
|
||||||
openstack.cloud.baremetal_node_info:
|
openstack.cloud.baremetal_node_info:
|
||||||
|
cloud: "{{ cloud_name | default(omit) }}"
|
||||||
auth_type: "{{ auth_type | default(omit) }}"
|
auth_type: "{{ auth_type | default(omit) }}"
|
||||||
auth: "{{ auth | default(omit) }}"
|
auth: "{{ auth | default(omit) }}"
|
||||||
|
ca_cert: "{{ tls_certificate_path | default(omit) }}"
|
||||||
node: "{{ inventory_hostname }}"
|
node: "{{ inventory_hostname }}"
|
||||||
ironic_url: "{{ ironic_url | default(omit) }}"
|
register: redeployed_node
|
||||||
register: node_info
|
|
||||||
roles:
|
roles:
|
||||||
- role: bifrost-unprovision-node-dynamic
|
- role: bifrost-unprovision-node-dynamic
|
||||||
when:
|
when:
|
||||||
- node_info.baremetal_nodes[0].provision_state == "active"
|
- redeployed_node.baremetal_nodes[0].provision_state == "active"
|
||||||
or node_info.baremetal_nodes[0].provision_state == "deploy failed"
|
or redeployed_node.baremetal_nodes[0].provision_state == "deploy failed"
|
||||||
or node_info.baremetal_nodes[0].provision_state == "error"
|
or redeployed_node.baremetal_nodes[0].provision_state == "error"
|
||||||
- not node_info.baremetal_nodes[0].maintenance | bool
|
# The field was renamed in ansible-collections-openstack 2.0.0
|
||||||
|
# FIXME(dtantsur) Remove the workaround once we require >=2.0.0
|
||||||
|
# - not redeployed_node.baremetal_nodes[0].is_maintenance | bool
|
||||||
|
- not redeployed_node.baremetal_nodes[0].maintenance | default(false) | bool
|
||||||
|
- not redeployed_node.baremetal_nodes[0].is_maintenance | default(false) | bool
|
||||||
post_tasks:
|
post_tasks:
|
||||||
- name: "Pull ironic facts until provision state available"
|
- name: "Pull ironic facts until provision state available"
|
||||||
openstack.cloud.baremetal_node_info:
|
openstack.cloud.baremetal_node_info:
|
||||||
|
cloud: "{{ cloud_name | default(omit) }}"
|
||||||
auth_type: "{{ auth_type | default(omit) }}"
|
auth_type: "{{ auth_type | default(omit) }}"
|
||||||
auth: "{{ auth | default(omit) }}"
|
auth: "{{ auth | default(omit) }}"
|
||||||
|
ca_cert: "{{ tls_certificate_path | default(omit) }}"
|
||||||
node: "{{ inventory_hostname }}"
|
node: "{{ inventory_hostname }}"
|
||||||
ironic_url: "{{ ironic_url | default(omit) }}"
|
register: redeployed_node
|
||||||
register: node_info
|
until: redeployed_node.baremetal_nodes[0].provision_state == "available"
|
||||||
until: node_info.baremetal_nodes[0].provision_state == "available"
|
# The timeout of 15 minutes accounts for cleaning
|
||||||
retries: "{{ available_state_wait_retries | default(15) }}"
|
retries: "{{ available_state_wait_retries | default(45) }}"
|
||||||
delay: "{{ provision_state_retry_interval | default(20) }}"
|
delay: "{{ provision_state_retry_interval | default(20) }}"
|
||||||
|
|
||||||
- hosts: baremetal
|
- hosts: baremetal
|
||||||
name: "Activate the nodes"
|
name: "Activate the nodes"
|
||||||
become: no
|
become: no
|
||||||
|
@ -61,20 +77,29 @@
|
||||||
roles:
|
roles:
|
||||||
- role: bifrost-configdrives-dynamic
|
- role: bifrost-configdrives-dynamic
|
||||||
when:
|
when:
|
||||||
- node_info.baremetal_nodes[0].provision_state == "available"
|
- redeployed_node.baremetal_nodes[0].provision_state == "available"
|
||||||
- not node_info.baremetal_nodes[0].maintenance | bool
|
# The field was renamed in ansible-collections-openstack 2.0.0
|
||||||
|
# FIXME(dtantsur) Remove the workaround once we require >=2.0.0
|
||||||
|
# - not redeployed_node.baremetal_nodes[0].is_maintenance | bool
|
||||||
|
- not redeployed_node.baremetal_nodes[0].maintenance | default(false) | bool
|
||||||
|
- not redeployed_node.baremetal_nodes[0].is_maintenance | default(false) | bool
|
||||||
- role: bifrost-deploy-nodes-dynamic
|
- role: bifrost-deploy-nodes-dynamic
|
||||||
when:
|
when:
|
||||||
- node_info.baremetal_nodes[0].provision_state == "available"
|
- redeployed_node.baremetal_nodes[0].provision_state == "available"
|
||||||
- not node_info.baremetal_nodes[0].maintenance | bool
|
# The field was renamed in ansible-collections-openstack 2.0.0
|
||||||
|
# FIXME(dtantsur) Remove the workaround once we require >=2.0.0
|
||||||
|
# - not redeployed_node.baremetal_nodes[0].is_maintenance | bool
|
||||||
|
- not redeployed_node.baremetal_nodes[0].maintenance | default(false) | bool
|
||||||
|
- not redeployed_node.baremetal_nodes[0].is_maintenance | default(false) | bool
|
||||||
post_tasks:
|
post_tasks:
|
||||||
- name: "Pull ironic facts until provision state active"
|
- name: "Pull ironic facts until provision state active"
|
||||||
openstack.cloud.baremetal_node_info:
|
openstack.cloud.baremetal_node_info:
|
||||||
|
cloud: "{{ cloud_name | default(omit) }}"
|
||||||
auth_type: "{{ auth_type | default(omit) }}"
|
auth_type: "{{ auth_type | default(omit) }}"
|
||||||
auth: "{{ auth | default(omit) }}"
|
auth: "{{ auth | default(omit) }}"
|
||||||
|
ca_cert: "{{ tls_certificate_path | default(omit) }}"
|
||||||
node: "{{ inventory_hostname }}"
|
node: "{{ inventory_hostname }}"
|
||||||
ironic_url: "{{ ironic_url | default(omit) }}"
|
register: redeployed_node
|
||||||
register: node_info
|
until: redeployed_node.baremetal_nodes[0].provision_state == "active"
|
||||||
until: node_info.baremetal_nodes[0].provision_state == "active"
|
|
||||||
retries: "{{ active_state_wait_retries | default(30) }}"
|
retries: "{{ active_state_wait_retries | default(30) }}"
|
||||||
delay: "{{ provision_state_retry_interval | default(20) }}"
|
delay: "{{ provision_state_retry_interval | default(20) }}"
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
---
|
---
|
||||||
|
# Ensure that Ansible is using python interpreter and dependencies inside the bifrost virtual environment
|
||||||
|
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"
|
||||||
|
ansible_python_interpreter: "{{ bifrost_venv_dir + '/bin/python3' }}"
|
||||||
|
|
||||||
noauth_mode: false
|
noauth_mode: false
|
||||||
|
|
||||||
network_interface: "virbr0"
|
network_interface: "virbr0"
|
||||||
|
|
|
@ -57,6 +57,9 @@
|
||||||
roles:
|
roles:
|
||||||
- role: bifrost-test-vm
|
- role: bifrost-test-vm
|
||||||
|
|
||||||
|
- import_playbook: redeploy-dynamic.yaml
|
||||||
|
when: redeploy_nodes | default(false) | bool
|
||||||
|
|
||||||
- hosts: baremetal
|
- hosts: baremetal
|
||||||
connection: local
|
connection: local
|
||||||
name: "Unprovisions the test node"
|
name: "Unprovisions the test node"
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixes the ``redeploy-dynamic`` playbook to work with TLS and other
|
||||||
|
non-default cloud settings.
|
|
@ -108,6 +108,8 @@ elif [ ${ENABLE_KEYSTONE} = "true" ]; then
|
||||||
CLOUD_CONFIG+=" -e cloud_name=bifrost"
|
CLOUD_CONFIG+=" -e cloud_name=bifrost"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
REDEPLOY_NODES=$USE_CIRROS
|
||||||
|
|
||||||
if [[ -n "$BOOT_MODE" ]]; then
|
if [[ -n "$BOOT_MODE" ]]; then
|
||||||
CLOUD_CONFIG+=" -e default_boot_mode=$BOOT_MODE"
|
CLOUD_CONFIG+=" -e default_boot_mode=$BOOT_MODE"
|
||||||
VM_SETUP_EXTRA+=" -e default_boot_mode=$BOOT_MODE"
|
VM_SETUP_EXTRA+=" -e default_boot_mode=$BOOT_MODE"
|
||||||
|
@ -187,6 +189,7 @@ ${ANSIBLE} -vvvv \
|
||||||
-e inventory_dhcp_static_ip=${INVENTORY_DHCP_STATIC_IP} \
|
-e inventory_dhcp_static_ip=${INVENTORY_DHCP_STATIC_IP} \
|
||||||
-e enable_inspector=${USE_INSPECTOR} \
|
-e enable_inspector=${USE_INSPECTOR} \
|
||||||
-e inspect_nodes=${INSPECT_NODES} \
|
-e inspect_nodes=${INSPECT_NODES} \
|
||||||
|
-e redeploy_nodes=${REDEPLOY_NODES} \
|
||||||
-e download_ipa=${DOWNLOAD_IPA} \
|
-e download_ipa=${DOWNLOAD_IPA} \
|
||||||
-e create_ipa_image=${CREATE_IPA_IMAGE} \
|
-e create_ipa_image=${CREATE_IPA_IMAGE} \
|
||||||
-e write_interfaces_file=${WRITE_INTERFACES_FILE} \
|
-e write_interfaces_file=${WRITE_INTERFACES_FILE} \
|
||||||
|
|
Loading…
Reference in New Issue