Skip to content

Commit e4b02c2

Browse files
committed
rename network_mac to mac_address in inventory for consistency
** Warning existing inventory files will need to be fixed ** run `sed -i 's/network_mac/mac_address/' my_inventory.yml` to fix this
1 parent 3e7727d commit e4b02c2

File tree

14 files changed

+42
-37
lines changed

14 files changed

+42
-37
lines changed

ansible/inventory/inventory-bm-byol.sample

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ bmc_user=redhat
1111
bmc_password=password
1212

1313
[controlplane]
14-
control-plane-0 bmc_address=172.29.170.70 network_mac=40:a6:b7:83:98:b0 lab_mac=ec:2a:72:33:15:f0 ip=198.18.10.5 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:01:00.0-nvme-1
15-
control-plane-1 bmc_address=172.29.170.71 network_mac=40:a6:b7:83:98:c0 lab_mac=ec:2a:72:33:16:c8 ip=198.18.10.6 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:3f:00.0-scsi-0:0:1:0
16-
control-plane-2 bmc_address=172.29.170.193 network_mac=b4:83:51:07:45:28 lab_mac=ec:2a:72:51:0a:f4 ip=198.18.10.7 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:4a:00.0-scsi-0:3:111:0
14+
control-plane-0 bmc_address=172.29.170.70 mac_address=40:a6:b7:83:98:b0 lab_mac=ec:2a:72:33:15:f0 ip=198.18.10.5 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:01:00.0-nvme-1
15+
control-plane-1 bmc_address=172.29.170.71 mac_address=40:a6:b7:83:98:c0 lab_mac=ec:2a:72:33:16:c8 ip=198.18.10.6 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:3f:00.0-scsi-0:0:1:0
16+
control-plane-2 bmc_address=172.29.170.193 mac_address=b4:83:51:07:45:28 lab_mac=ec:2a:72:51:0a:f4 ip=198.18.10.7 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:4a:00.0-scsi-0:3:111:0
1717

1818
[controlplane:vars]
1919
role=master
@@ -28,8 +28,8 @@ dns1=198.18.10.1
2828
dns2=172.29.202.10
2929

3030
[worker]
31-
worker-0 bmc_address=172.29.170.219 network_mac=b4:96:91:f2:d3:90 lab_mac=ec:2a:72:33:17:2a ip=198.18.10.8 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:01:00.0-nvme-1
32-
worker-1 bmc_address=172.29.170.73 network_mac=00:62:0b:2f:2b:50 lab_mac=c8:4b:d6:8d:78:2e ip=198.18.10.9 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:3e:00.0-nvme-1
31+
worker-0 bmc_address=172.29.170.219 mac_address=b4:96:91:f2:d3:90 lab_mac=ec:2a:72:33:17:2a ip=198.18.10.8 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:01:00.0-nvme-1
32+
worker-1 bmc_address=172.29.170.73 mac_address=00:62:0b:2f:2b:50 lab_mac=c8:4b:d6:8d:78:2e ip=198.18.10.9 vendor=Dell install_disk=/dev/disk/by-path/pci-0000:3e:00.0-nvme-1
3333

3434
[worker:vars]
3535
role=worker

ansible/inventory/inventory-bm.sample

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ bmc_user=quads
1010
bmc_password=password
1111

1212
[controlplane]
13-
control-plane-0 bmc_address=mgmt-control-plane-0.example.com network_mac=40:a6:b7:2a:74:40 lab_mac=bc:97:e1:7a:d4:40 ip=198.18.10.5 vendor=Dell install_disk=/dev/sda
14-
control-plane-1 bmc_address=mgmt-control-plane-1.example.com network_mac=40:a6:b7:2a:98:90 lab_mac=bc:97:e1:78:c7:f0 ip=198.18.10.6 vendor=Dell install_disk=/dev/sda
15-
control-plane-2 bmc_address=mgmt-control-plane-2.example.com network_mac=40:a6:b7:2a:6b:f0 lab_mac=bc:97:e1:7a:ce:70 ip=198.18.10.7 vendor=Dell install_disk=/dev/sda
13+
control-plane-0 bmc_address=mgmt-control-plane-0.example.com mac_address=40:a6:b7:2a:74:40 lab_mac=bc:97:e1:7a:d4:40 ip=198.18.10.5 vendor=Dell install_disk=/dev/sda
14+
control-plane-1 bmc_address=mgmt-control-plane-1.example.com mac_address=40:a6:b7:2a:98:90 lab_mac=bc:97:e1:78:c7:f0 ip=198.18.10.6 vendor=Dell install_disk=/dev/sda
15+
control-plane-2 bmc_address=mgmt-control-plane-2.example.com mac_address=40:a6:b7:2a:6b:f0 lab_mac=bc:97:e1:7a:ce:70 ip=198.18.10.7 vendor=Dell install_disk=/dev/sda
1616

1717
[controlplane:vars]
1818
role=master
@@ -27,8 +27,8 @@ dns1=198.18.10.1
2727
dns2=10.1.36.1
2828

2929
[worker]
30-
worker-0 bmc_address=mgmt-worker-0.example.com network_mac=40:a6:b7:2a:75:f1 lab_mac=bc:97:e1:7a:ce:71 ip=198.18.10.8 vendor=Dell install_disk=/dev/sda
31-
worker-1 bmc_address=mgmt-worker-1.example.com network_mac=40:a6:b7:2b:bc:01 lab_mac=bc:97:e1:7a:ce:72 ip=198.18.10.9 vendor=Dell install_disk=/dev/sda
30+
worker-0 bmc_address=mgmt-worker-0.example.com mac_address=40:a6:b7:2a:75:f1 lab_mac=bc:97:e1:7a:ce:71 ip=198.18.10.8 vendor=Dell install_disk=/dev/sda
31+
worker-1 bmc_address=mgmt-worker-1.example.com mac_address=40:a6:b7:2b:bc:01 lab_mac=bc:97:e1:7a:ce:72 ip=198.18.10.9 vendor=Dell install_disk=/dev/sda
3232

3333
[worker:vars]
3434
role=worker

ansible/inventory/inventory-sno.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ bmc_password=password
2323

2424
[sno]
2525
# Single Node OpenShift Clusters
26-
sno-0 bmc_address=mgmt-sno-0.example.com boot_iso=sno-0.iso ip=10.0.0.1 vendor=Dell lab_mac=00:4e:01:3d:e6:9e network_mac=40:a6:b7:00:63:61 install_disk=/dev/sda
27-
sno-1 bmc_address=mgmt-sno-1.example.com boot_iso=sno-1.iso ip=10.0.0.2 vendor=Dell lab_mac=00:4e:01:3d:e6:ab network_mac=40:a6:b7:00:53:81 install_disk=/dev/sda
26+
sno-0 bmc_address=mgmt-sno-0.example.com boot_iso=sno-0.iso ip=10.0.0.1 vendor=Dell lab_mac=00:4e:01:3d:e6:9e mac_address=40:a6:b7:00:63:61 install_disk=/dev/sda
27+
#sno-1 bmc_address=mgmt-sno-1.example.com boot_iso=sno-1.iso ip=10.0.0.2 vendor=Dell lab_mac=00:4e:01:3d:e6:ab mac_address=40:a6:b7:00:53:81 install_disk=/dev/sda
2828

2929
[sno:vars]
3030
bmc_user=quads

ansible/roles/create-ai-cluster/templates/mac_interface_map.json.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
3-
"mac_address": "{{ hostvars[item]['network_mac'] }}",
3+
"mac_address": "{{ hostvars[item]['mac_address'] }}",
44
"logical_nic_name": "{{ hostvars[item]['network_interface'] }}"
55
},
66
{

ansible/roles/create-inventory/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@
8787
controlplane0: "{{ ocpinventory.json.nodes[1].pm_addr }}"
8888
controlplane1: "{{ ocpinventory.json.nodes[2].pm_addr }}"
8989
controlplane2: "{{ ocpinventory.json.nodes[3].pm_addr }}"
90-
controlplane0_network_mac: "{{ ocpinventory.json.nodes[1].mac[controlplane_network_interface_idx | int] }}"
91-
controlplane1_network_mac: "{{ ocpinventory.json.nodes[2].mac[controlplane_network_interface_idx | int] }}"
92-
controlplane2_network_mac: "{{ ocpinventory.json.nodes[3].mac[controlplane_network_interface_idx | int] }}"
90+
controlplane0_mac_address: "{{ ocpinventory.json.nodes[1].mac[controlplane_network_interface_idx | int] }}"
91+
controlplane1_mac_address: "{{ ocpinventory.json.nodes[2].mac[controlplane_network_interface_idx | int] }}"
92+
controlplane2_mac_address: "{{ ocpinventory.json.nodes[3].mac[controlplane_network_interface_idx | int] }}"
9393
controlplane0_vendor: "{{ hw_vendor[(ocpinventory.json.nodes[1].pm_addr.split('.')[0]).split('-')[-1]] }}"
9494
controlplane1_vendor: "{{ hw_vendor[(ocpinventory.json.nodes[2].pm_addr.split('.')[0]).split('-')[-1]] }}"
9595
controlplane2_vendor: "{{ hw_vendor[(ocpinventory.json.nodes[3].pm_addr.split('.')[0]).split('-')[-1]] }}"

ansible/roles/create-inventory/templates/inventory-mno.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ bmc_user={{ bmc_user }}
2020
bmc_password={{ bmc_password }}
2121

2222
[controlplane]
23-
{{ controlplane0.split('.')[0] | replace('mgmt-','') }} bmc_address={{ controlplane0 }} network_mac={{ controlplane0_network_mac }} lab_mac={{ controlplane0_lab_mac }} ip={{ controlplane_network | ansible.utils.nthhost(5) }} vendor={{ controlplane0_vendor }} install_disk={{ control_plane_install_disk }}
24-
{{ controlplane1.split('.')[0] | replace('mgmt-','') }} bmc_address={{ controlplane1 }} network_mac={{ controlplane1_network_mac }} lab_mac={{ controlplane1_lab_mac }} ip={{ controlplane_network | ansible.utils.nthhost(6) }} vendor={{ controlplane1_vendor }} install_disk={{ control_plane_install_disk }}
25-
{{ controlplane2.split('.')[0] | replace('mgmt-','') }} bmc_address={{ controlplane2 }} network_mac={{ controlplane2_network_mac }} lab_mac={{ controlplane2_lab_mac }} ip={{ controlplane_network | ansible.utils.nthhost(7) }} vendor={{ controlplane2_vendor }} install_disk={{ control_plane_install_disk }}
23+
{{ controlplane0.split('.')[0] | replace('mgmt-','') }} bmc_address={{ controlplane0 }} mac_address={{ controlplane0_mac_address }} lab_mac={{ controlplane0_lab_mac }} ip={{ controlplane_network | ansible.utils.nthhost(5) }} vendor={{ controlplane0_vendor }} install_disk={{ control_plane_install_disk }}
24+
{{ controlplane1.split('.')[0] | replace('mgmt-','') }} bmc_address={{ controlplane1 }} mac_address={{ controlplane1_mac_address }} lab_mac={{ controlplane1_lab_mac }} ip={{ controlplane_network | ansible.utils.nthhost(6) }} vendor={{ controlplane1_vendor }} install_disk={{ control_plane_install_disk }}
25+
{{ controlplane2.split('.')[0] | replace('mgmt-','') }} bmc_address={{ controlplane2 }} mac_address={{ controlplane2_mac_address }} lab_mac={{ controlplane2_lab_mac }} ip={{ controlplane_network | ansible.utils.nthhost(7) }} vendor={{ controlplane2_vendor }} install_disk={{ control_plane_install_disk }}
2626

2727
[controlplane:vars]
2828
role=master
@@ -42,7 +42,7 @@ dns2={{ labs[lab]['dns'][1] | default('') }}
4242

4343
[worker]
4444
{% for worker in ocpinventory_worker_nodes %}
45-
{{ worker.pm_addr.split('.')[0] | replace('mgmt-','') }} bmc_address={{ worker.pm_addr }} network_mac={{ worker.mac[controlplane_network_interface_idx|int] }} lab_mac={{ ( (mno_foreman_data.results| selectattr('json.name', 'eq', worker.pm_addr | replace('mgmt-',''))|first).json.interfaces | selectattr('primary', 'eq', True)|first).mac }} ip={{ controlplane_network | ansible.utils.nthhost(loop.index + mno_worker_node_offset) }} vendor={{ hw_vendor[(worker.pm_addr.split('.')[0]).split('-')[-1]] }} install_disk={{ worker_install_disk }}
45+
{{ worker.pm_addr.split('.')[0] | replace('mgmt-','') }} bmc_address={{ worker.pm_addr }} mac_address={{ worker.mac[controlplane_network_interface_idx|int] }} lab_mac={{ ( (mno_foreman_data.results| selectattr('json.name', 'eq', worker.pm_addr | replace('mgmt-',''))|first).json.interfaces | selectattr('primary', 'eq', True)|first).mac }} ip={{ controlplane_network | ansible.utils.nthhost(loop.index + mno_worker_node_offset) }} vendor={{ hw_vendor[(worker.pm_addr.split('.')[0]).split('-')[-1]] }} install_disk={{ worker_install_disk }}
4646
{% endfor %}
4747

4848
[worker:vars]

ansible/roles/create-inventory/templates/inventory-sno.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bmc_password={{ bmc_password }}
3535
{%- else -%}
3636
{%- set ip=(sno_foreman_data.results|selectattr('json.name', 'eq', sno.pm_addr | replace('mgmt-',''))|first).json.ip -%}
3737
{%- endif -%}
38-
{% if not loop.first %}# {% endif %}{{ sno.pm_addr.split('.')[0] | replace('mgmt-','') }} bmc_address={{ sno.pm_addr }} boot_iso={{ sno.pm_addr.split('.')[0] | replace('mgmt-','') }}.iso ip={{ ip }} vendor={{ hw_vendor[(sno.pm_addr.split('.')[0]).split('-')[-1]] }} lab_mac={{ (sno_foreman_data.results|selectattr('json.name', 'eq', sno.pm_addr | replace('mgmt-',''))|first) | json_query(mac_query) | join(', ') }} network_mac={{ sno.mac[controlplane_network_interface_idx] }} install_disk={{ sno_install_disk }}
38+
{% if not loop.first %}# {% endif %}{{ sno.pm_addr.split('.')[0] | replace('mgmt-','') }} bmc_address={{ sno.pm_addr }} boot_iso={{ sno.pm_addr.split('.')[0] | replace('mgmt-','') }}.iso ip={{ ip }} vendor={{ hw_vendor[(sno.pm_addr.split('.')[0]).split('-')[-1]] }} lab_mac={{ (sno_foreman_data.results|selectattr('json.name', 'eq', sno.pm_addr | replace('mgmt-',''))|first) | json_query(mac_query) | join(', ') }} mac_address={{ sno.mac[controlplane_network_interface_idx] }} install_disk={{ sno_install_disk }}
3939
{% endfor %}
4040

4141
[sno:vars]

ansible/roles/sno-create-ai-cluster/templates/mac_interface_map.json.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
3-
"mac_address": "{{ hostvars[item]['network_mac'] }}",
3+
"mac_address": "{{ hostvars[item]['mac_address'] }}",
44
"logical_nic_name": "{{ hostvars[item]['network_interface'] }}"
55
},
66
{

ansible/roles/validate-vars/tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,8 @@
9090
fail:
9191
msg: "isolated_cpus is unset"
9292
when: (cluster_type == "sno") and (du_profile | default(false) | bool) and isolated_cpus is undefined
93+
94+
- name: Inventory network_mac parameters have been renamed to mac_address
95+
fail:
96+
msg: "Rerun create-inventory to fix this"
97+
when: hostvars | json_query('(*)[?network_mac]')

docs/deploy-mno-byol.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ bmc_user=root
362362
bmc_password=password
363363
364364
[controlplane]
365-
control-plane-0 bmc_address=<IP or FQDN> network_mac=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.5 vendor=Dell install_disk=/dev/disk/by-path/...
366-
control-plane-1 bmc_address=<IP or FQDN> network_mac=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.6 vendor=Dell install_disk=/dev/disk/by-path/...
367-
control-plane-2 bmc_address=<IP or FQDN> network_mac=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.7 vendor=Dell install_disk=/dev/disk/by-path/...
365+
control-plane-0 bmc_address=<IP or FQDN> mac_address=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.5 vendor=Dell install_disk=/dev/disk/by-path/...
366+
control-plane-1 bmc_address=<IP or FQDN> mac_address=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.6 vendor=Dell install_disk=/dev/disk/by-path/...
367+
control-plane-2 bmc_address=<IP or FQDN> mac_address=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.7 vendor=Dell install_disk=/dev/disk/by-path/...
368368
369369
[controlplane:vars]
370370
role=master
@@ -376,11 +376,11 @@ network_interface=<anything>
376376
network_prefix=24
377377
gateway=198.18.10.1
378378
dns1=198.18.10.1
379-
dns2=<DNS network_mac>
379+
dns2=<DNS ip_address>
380380
381381
[worker]
382-
worker-0 bmc_address=172.29.170.219 network_mac=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.8 vendor=Dell install_disk=/dev/disk/by-path/...
383-
worker-1 bmc_address=172.29.170.73 network_mac=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.9 vendor=Dell install_disk=/dev/disk/by-path/...
382+
worker-0 bmc_address=172.29.170.219 mac_address=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.8 vendor=Dell install_disk=/dev/disk/by-path/...
383+
worker-1 bmc_address=172.29.170.73 mac_address=<L3 NIC> lab_mac=<L2 NIC> ip=198.18.10.9 vendor=Dell install_disk=/dev/disk/by-path/...
384384
385385
[worker:vars]
386386
role=worker
@@ -392,7 +392,7 @@ network_interface=<anything>
392392
network_prefix=24
393393
gateway=198.18.10.1
394394
dns1=198.18.10.1
395-
dns2=<DNS network_mac>
395+
dns2=<DNS ip_address>
396396
397397
[sno]
398398
[sno:vars]

0 commit comments

Comments
 (0)