Wait for cleaning to be over when enrolling

Currently we're relying on the baremetal_node module to create a node in
the available state. This will soon imply cleaning, but the module is
not ready to deal with it: it does not wait by default and there is no
wait option. Just loop until it's done.

Change-Id: Ia4b290e3c7e2041e249b947248123d9fb52dae08
This commit is contained in:
Dmitry Tantsur 2022-07-13 11:11:31 +02:00
parent 034a6b5699
commit c80a7b7d0c
1 changed files with 14 additions and 0 deletions

View File

@ -32,3 +32,17 @@
nics: "{{ nics }}"
properties: "{{ properties | default({}) }}"
driver_info: "{{ driver_info | default(omit) }}"
# FIXME(dtantsur): the baremetal_node module should do it or at least provide
# a wait argument. Work around until then
- name: "Wait for the node to finish cleaning"
openstack.cloud.baremetal_node_info:
cloud: "{{ cloud_name | default(omit) }}"
auth_type: "{{ auth_type | default(omit) }}"
auth: "{{ auth | default(omit) }}"
ca_cert: "{{ tls_certificate_path | default(omit) }}"
node: "{{ name | default(uuid) }}"
register: enrolled_node_info
until: enrolled_node_info.baremetal_nodes[0].provision_state == "available"
retries: "{{ available_state_wait_retries | default(45) }}"
delay: "{{ provision_state_retry_interval | default(20) }}"