diff options
Diffstat (limited to 'deploy/adapters/ansible/roles/config-controller')
5 files changed, 42 insertions, 12 deletions
diff --git a/deploy/adapters/ansible/roles/config-controller/tasks/RedHat.yml b/deploy/adapters/ansible/roles/config-controller/tasks/RedHat.yml index cc14347a..58bc2bf7 100644 --- a/deploy/adapters/ansible/roles/config-controller/tasks/RedHat.yml +++ b/deploy/adapters/ansible/roles/config-controller/tasks/RedHat.yml @@ -7,32 +7,30 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -# yamllint disable rule:line-length - name: generate tenant vlan ifcfg-if script template: src: ifcfg-if.tenant - dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["tenant"]["interface"]}}.{{contr_sys_mappings["tenant"]["vlan_tag"]}} + dest: /etc/sysconfig/network-scripts/ifcfg-{{ intf_tenant }} - name: generate storage vlan ifcfg-if script template: src: ifcfg-if.storage - dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["storage"]["interface"]}}.{{contr_sys_mappings["storage"]["vlan_tag"]}} + dest: /etc/sysconfig/network-scripts/ifcfg-{{ intf_storage }} - name: add br-external to interface script lineinfile: - dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["external"]["interface"]}} + dest: /etc/sysconfig/network-scripts/ifcfg-{{ intf_external }} line: "BRIDGE=br-external" - name: add br-storage to interface script lineinfile: - dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["storage"]["interface"]}}.{{contr_sys_mappings["storage"]["vlan_tag"]}} + dest: /etc/sysconfig/network-scripts/ifcfg-{{ intf_storage }} line: "BRIDGE=br-storage" - name: add br-tenant to interface script lineinfile: - dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["tenant"]["interface"]}}.{{contr_sys_mappings["tenant"]["vlan_tag"]}} + dest: /etc/sysconfig/network-scripts/ifcfg-{{ intf_tenant }} line: "BRIDGE=br-tenant" -# yamllint enable rule:line-length - name: remove eth0 ip addresss lineinfile: diff --git a/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-br-mgmt b/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-br-mgmt index 2e958cc7..184f752b 100644 --- a/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-br-mgmt +++ b/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-br-mgmt @@ -5,3 +5,4 @@ PREFIX=24 BOOTPROTO=none ONBOOT=yes DELAY=0 +DEFROUTE="no" diff --git a/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-if.storage b/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-if.storage index b71a80cf..c0a14049 100644 --- a/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-if.storage +++ b/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-if.storage @@ -1,4 +1,9 @@ -DEVICE={{contr_sys_mappings["storage"]["interface"]}}.{{contr_sys_mappings["storage"]["vlan_tag"]}} -BOOTPROTO=none +DEVICE={{ intf_storage }} ONBOOT=yes -VLAN=yes +{% if contr_sys_mappings["storage"]["vlan_tag"] | int %} +{% set intf_vlan = "yes" %} +{% else %} +{% set intf_vlan = "no" %} +{% endif %} +VLAN={{ intf_vlan }} +BOOTPROTO=none diff --git a/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-if.tenant b/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-if.tenant index bc9f2a57..b45c001f 100644 --- a/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-if.tenant +++ b/deploy/adapters/ansible/roles/config-controller/templates/ifcfg-if.tenant @@ -1,4 +1,9 @@ -DEVICE={{contr_sys_mappings["tenant"]["interface"]}}.{{contr_sys_mappings["tenant"]["vlan_tag"]}} +DEVICE={{ intf_tenant }} BOOTPROTO=none ONBOOT=yes -VLAN=yes +{% 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/config-controller/vars/main.yml b/deploy/adapters/ansible/roles/config-controller/vars/main.yml index 783ea0d0..701ec52b 100644 --- a/deploy/adapters/ansible/roles/config-controller/vars/main.yml +++ b/deploy/adapters/ansible/roles/config-controller/vars/main.yml @@ -8,3 +8,24 @@ # ############################################################################# --- LOCAL_REPOSITORY_IP: "192.168.137.222" + +intf_external: |- + {%- set intf_external = contr_sys_mappings["external"]["interface"] %} + {%- if contr_sys_mappings["external"]["vlan_tag"] | int %} + {%- set intf_external = intf_external + '.' + contr_sys_mappings["external"]["vlan_tag"]|string %} + {%- endif %} + {{- intf_external }} + +intf_tenant: |- + {%- set intf_tenant = contr_sys_mappings["tenant"]["interface"] %} + {%- if contr_sys_mappings["tenant"]["vlan_tag"] | int %} + {%- set intf_tenant = intf_tenant + '.' + contr_sys_mappings["tenant"]["vlan_tag"]|string %} + {%- endif %} + {{- intf_tenant }} + +intf_storage: |- + {%- set intf_storage = contr_sys_mappings["storage"]["interface"] %} + {%- if contr_sys_mappings["storage"]["vlan_tag"] | int %} + {%- set intf_storage = intf_storage + '.' + contr_sys_mappings["storage"]["vlan_tag"]|string %} + {%- endif %} + {{- intf_storage }} |