From e54c934e8d3e64873a83cbac15813310eb89c7cf Mon Sep 17 00:00:00 2001 From: Neeraj Mishra Date: Tue, 31 Mar 2026 01:05:17 +0530 Subject: [PATCH] feat(abi): enable rootDeviceHints support --- .../default/group_vars/all.yaml.template | 3 ++- .../templates/agent-config.yaml.j2 | 21 ++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/inventories/default/group_vars/all.yaml.template b/inventories/default/group_vars/all.yaml.template index 8d5048db2..012a86190 100644 --- a/inventories/default/group_vars/all.yaml.template +++ b/inventories/default/group_vars/all.yaml.template @@ -142,7 +142,8 @@ env: # - X # - X # - X - + root_device_hints: + - '' # Section 9 - Compute Nodes compute: disk_size: 120 diff --git a/roles/prepare_configs/templates/agent-config.yaml.j2 b/roles/prepare_configs/templates/agent-config.yaml.j2 index 574561f08..03faa3dde 100644 --- a/roles/prepare_configs/templates/agent-config.yaml.j2 +++ b/roles/prepare_configs/templates/agent-config.yaml.j2 @@ -9,6 +9,16 @@ hosts: {% for item in range( env.cluster.nodes.control.ip | length ) %} - hostname: "{{ env.cluster.nodes.control.hostname[item] }}" role: master +{% if env.cluster.nodes.control.root_device_hints is defined and env.cluster.nodes.control.root_device_hints[item] %} + rootDeviceHints: + deviceName: "{{ env.cluster.nodes.control.root_device_hints[item] }}" +{% elif env.lpar.storage_group_1 is defined and env.lpar.storage_group_1.dev_num is defined %} + rootDeviceHints: + {%- set dev = env.lpar.storage_group_1.dev_num -%} + {%- set wwpn = env.lpar.storage_group_1.storage_wwpn[0] -%} + {%- set lun = env.lpar.storage_group_1.lun_name %} + deviceName: "/dev/disk/by-path/ccw-{{ dev }}-fc-{{ wwpn }}-lun-{{ lun }}" +{% endif %} interfaces: - name: eth0 macAddress: "{{ env.cluster.nodes.control.mac[item] }}" @@ -33,12 +43,17 @@ hosts: - destination: 0.0.0.0/0 next-hop-address: "{{ env.bastion.networking.gateway }}" next-hop-interface: eth0 - table-id: 254 + table-id: 254 {% endfor %} + {% if env.cluster.nodes.compute.ip is defined %} {% for item in range( env.cluster.nodes.compute.ip | length ) %} - hostname: "{{ env.cluster.nodes.compute.hostname[item] }}" role: worker +{% if env.cluster.nodes.compute.root_device_hints is defined and env.cluster.nodes.compute.root_device_hints[item] %} + rootDeviceHints: + deviceName: "{{ env.cluster.nodes.compute.root_device_hints[item] }}" +{% endif %} interfaces: - name: eth0 macAddress: "{{ env.cluster.nodes.compute.mac[item] }}" @@ -63,7 +78,7 @@ hosts: - destination: 0.0.0.0/0 next-hop-address: "{{ env.bastion.networking.gateway }}" next-hop-interface: eth0 - table-id: 254 + table-id: 254 {% endfor %} {% endif %} -{% endif %} \ No newline at end of file +{% endif %}