diff options
Diffstat (limited to 'deploy/adapters/ansible/roles/post-osa')
4 files changed, 38 insertions, 7 deletions
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/RedHat.yml b/deploy/adapters/ansible/roles/post-osa/tasks/RedHat.yml index 287fd515..dce89ef8 100644 --- a/deploy/adapters/ansible/roles/post-osa/tasks/RedHat.yml +++ b/deploy/adapters/ansible/roles/post-osa/tasks/RedHat.yml @@ -33,17 +33,17 @@ - name: generate ifcfg-external template: src: ifcfg-external.j2 - dest: /etc/sysconfig/network-scripts/ifcfg-{{compu_sys_mappings["external"]["interface"]}} + dest: /etc/sysconfig/network-scripts/ifcfg-{{ intf_external }} - name: generate ifcfg-storage template: src: ifcfg-storage.j2 - dest: /etc/sysconfig/network-scripts/ifcfg-{{compu_sys_mappings["storage"]["interface"]}}.{{compu_sys_mappings["storage"]["vlan_tag"]}} + dest: /etc/sysconfig/network-scripts/ifcfg-{{ intf_storage }} - name: generate ifcfg-tenant template: src: ifcfg-tenant.j2 - dest: /etc/sysconfig/network-scripts/ifcfg-{{compu_sys_mappings["tenant"]["interface"]}}.{{compu_sys_mappings["tenant"]["vlan_tag"]}} + dest: /etc/sysconfig/network-scripts/ifcfg-{{ intf_tenant }} # yamllint enable rule:line-length diff --git a/deploy/adapters/ansible/roles/post-osa/templates/ifcfg-storage.j2 b/deploy/adapters/ansible/roles/post-osa/templates/ifcfg-storage.j2 index 338da8c4..98cce6cb 100644 --- a/deploy/adapters/ansible/roles/post-osa/templates/ifcfg-storage.j2 +++ b/deploy/adapters/ansible/roles/post-osa/templates/ifcfg-storage.j2 @@ -1,7 +1,12 @@ -DEVICE={{compu_sys_mappings["storage"]["interface"]}}.{{compu_sys_mappings["storage"]["vlan_tag"]}} +DEVICE={{ intf_storage }} BOOTPROTO=none ONBOOT=yes -VLAN=yes IPADDR={{ ip_settings[inventory_hostname]["storage"]["ip"] }} NETMASK=255.255.255.0 DEFROUTE="no" +{% if contr_sys_mappings["storage"]["vlan_tag"] | int %} +{% set intf_vlan = "yes" %} +{% else %} +{% set intf_vlan = "no" %} +{% endif %} +VLAN={{ intf_vlan }} diff --git a/deploy/adapters/ansible/roles/post-osa/templates/ifcfg-tenant.j2 b/deploy/adapters/ansible/roles/post-osa/templates/ifcfg-tenant.j2 index 15230c96..fce9b572 100644 --- a/deploy/adapters/ansible/roles/post-osa/templates/ifcfg-tenant.j2 +++ b/deploy/adapters/ansible/roles/post-osa/templates/ifcfg-tenant.j2 @@ -1,7 +1,12 @@ -DEVICE={{compu_sys_mappings["tenant"]["interface"]}}.{{compu_sys_mappings["tenant"]["vlan_tag"]}} +DEVICE={{ intf_tenant }} BOOTPROTO=none ONBOOT=yes -VLAN=yes IPADDR={{ ip_settings[inventory_hostname]["tenant"]["ip"] }} NETMASK=255.255.255.0 DEFROUTE="no" +{% if contr_sys_mappings["tenant"]["vlan_tag"] | int %} +{% set intf_vlan = "yes" %} +{% else %} +{% set intf_vlan = "no" %} +{% endif %} +VLAN={{ intf_vlan }} diff --git a/deploy/adapters/ansible/roles/post-osa/vars/main.yml b/deploy/adapters/ansible/roles/post-osa/vars/main.yml index 4feb9756..da886028 100644 --- a/deploy/adapters/ansible/roles/post-osa/vars/main.yml +++ b/deploy/adapters/ansible/roles/post-osa/vars/main.yml @@ -3,3 +3,24 @@ sfc_plugins: src: sfc.conf dst: /opt/sfc.conf + +intf_external: |- + {%- set intf_external = compu_sys_mappings["external"]["interface"] %} + {%- if compu_sys_mappings["external"]["vlan_tag"] | int %} + {%- set intf_external = intf_external + '.' + compu_sys_mappings["external"]["vlan_tag"]|string %} + {%- endif %} + {{- intf_external }} + +intf_tenant: |- + {%- set intf_tenant = compu_sys_mappings["tenant"]["interface"] %} + {%- if compu_sys_mappings["tenant"]["vlan_tag"] | int %} + {%- set intf_tenant = intf_tenant + '.' + compu_sys_mappings["tenant"]["vlan_tag"]|string %} + {%- endif %} + {{- intf_tenant }} + +intf_storage: |- + {%- set intf_storage = compu_sys_mappings["storage"]["interface"] %} + {%- if compu_sys_mappings["storage"]["vlan_tag"] | int %} + {%- set intf_storage = intf_storage + '.' + compu_sys_mappings["storage"]["vlan_tag"]|string %} + {%- endif %} + {{- intf_storage }} |