File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change 9
9
network_allocation_path : " {{ kayobe_env_config_path }}/network-allocation.yml"
10
10
tasks :
11
11
- name : Show baremetal node
12
- ansible.builtin.shell :
12
+ ansible.builtin.command :
13
13
cmd : " openstack baremetal node show {{ inventory_hostname }} -f json"
14
14
register : node_show
15
15
failed_when : false
16
16
changed_when : false
17
17
delegate_to : localhost
18
18
19
- - block :
19
+ - name : Update network allocations
20
+ when : ' "HTTP 404" not in node_show.stderr'
21
+ block :
20
22
- name : Read network allocations
21
23
ansible.builtin.set_fact :
22
24
net_alc_yaml : " {{ admin_oc_net_ips }}"
31
33
ansible.builtin.copy :
32
34
content : " {{ new_net_alc | to_nice_yaml(indent=2) }}"
33
35
dest : " {{ network_allocation_path }}"
34
- when :
35
- - ' "HTTP 404" not in node_show.stderr'
36
36
37
37
- name : Deploy baremetal compute nodes as hypervisors
38
38
hosts : compute
39
39
gather_facts : false
40
40
connection : local
41
41
tasks :
42
42
- name : Show baremetal node
43
- ansible.builtin.shell :
43
+ ansible.builtin.command :
44
44
cmd : " openstack baremetal node show {{ inventory_hostname }} -f json"
45
45
register : node_show
46
46
failed_when : false
53
53
failed_when : false
54
54
changed_when : false
55
55
56
- - block :
57
- - name : Create port
56
+ - name : Deploy baremetal instance
57
+ when :
58
+ - ' "HTTP 404" not in node_show.stderr'
59
+ - ' "available" in node_show_json.provision_state'
60
+ block :
61
+ - name : Configure network for baremetal instance
58
62
openstack.cloud.port :
59
63
state : present
60
64
name : " {{ inventory_hostname }}"
83
87
ironic_node : " {{ inventory_hostname }}"
84
88
delegate_to : localhost
85
89
register : server
86
- when :
87
- - ' "HTTP 404" not in node_show.stderr'
88
- - ' "available" in node_show_json.provision_state'
You can’t perform that action at this time.
0 commit comments