Move configuration network templates 41/52841/7
authorVictor Morales <victor.morales@intel.com>
Mon, 19 Mar 2018 14:41:50 +0000 (07:41 -0700)
committerVictor Morales <victor.morales@intel.com>
Fri, 6 Apr 2018 11:03:02 +0000 (04:03 -0700)
The jinja templates that are used for networking setup are based on the
openstack-ansible needs, those needs can differ for another installers.
This change propose to make the network configuration depending on the
installer.

Signed-off-by: Victor Morales <victor.morales@intel.com>
Change-Id: Ie805c3c7716393377d4dfcb32ed794cc1039d515

xci/playbooks/roles/bootstrap-host/tasks/network.yml
xci/playbooks/roles/bootstrap-host/templates/osa/debian/compute00.interface.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/debian/compute00.interface.j2 with 100% similarity]
xci/playbooks/roles/bootstrap-host/templates/osa/debian/compute01.interface.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/debian/compute01.interface.j2 with 100% similarity]
xci/playbooks/roles/bootstrap-host/templates/osa/debian/controller00.interface.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/debian/controller00.interface.j2 with 100% similarity]
xci/playbooks/roles/bootstrap-host/templates/osa/debian/controller01.interface.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/debian/controller01.interface.j2 with 100% similarity]
xci/playbooks/roles/bootstrap-host/templates/osa/debian/controller02.interface.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/debian/controller02.interface.j2 with 100% similarity]
xci/playbooks/roles/bootstrap-host/templates/osa/debian/opnfv.interface.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/debian/opnfv.interface.j2 with 100% similarity]
xci/playbooks/roles/bootstrap-host/templates/osa/redhat/bridge.ifcfg.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/redhat/bridge.ifcfg.j2 with 100% similarity]
xci/playbooks/roles/bootstrap-host/templates/osa/redhat/interface.ifcfg.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/redhat/interface.ifcfg.j2 with 100% similarity]
xci/playbooks/roles/bootstrap-host/templates/osa/suse/suse.interface.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/suse/suse.interface.j2 with 100% similarity]
xci/playbooks/roles/bootstrap-host/templates/osa/suse/suse.routes.j2 [moved from xci/playbooks/roles/bootstrap-host/templates/suse/suse.routes.j2 with 100% similarity]

index 92e9195..723db48 100644 (file)
@@ -70,7 +70,7 @@
         - directory
     - name: ensure interfaces file is updated
       template:
-        src: "{{ ansible_os_family | lower }}/{{ ansible_hostname }}.interface.j2"
+        src: "{{ installer_type }}/{{ ansible_os_family | lower }}/{{ ansible_hostname }}.interface.j2"
         dest: "/etc/network/interfaces"
     - name: restart network service
       shell: "/sbin/ifconfig {{ ansible_local.xci.network.xci_interface }} 0 && /sbin/ifdown -a && /sbin/ifup -a"
@@ -81,7 +81,7 @@
 - block:
     - name: Configure networking on SUSE
       template:
-        src: "{{ ansible_os_family | lower }}/suse.interface.j2"
+        src: "{{ installer_type }}/{{ ansible_os_family | lower }}/suse.interface.j2"
         dest: "/etc/sysconfig/network/ifcfg-{{ item.name }}"
       with_items:
         - { name: "{{ ansible_local.xci.network.xci_interface }}" }
 
     - name: Configure routes on SUSE
       template:
-        src: "{{ ansible_os_family | lower }}/suse.routes.j2"
+        src: "{{ installer_type }}/{{ ansible_os_family | lower }}/suse.routes.j2"
         dest: "/etc/sysconfig/network/ifroute-{{ item.name }}"
       with_items:
         - { name: "br-vlan", gateway: "192.168.122.1", route: "default" }
 - block:
     - name: Configure networking on CentOS for interfaces
       template:
-        src: "{{ ansible_os_family | lower }}/interface.ifcfg.j2"
+        src: "{{ installer_type }}/{{ ansible_os_family | lower }}/interface.ifcfg.j2"
         dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.name }}"
       with_items:
         - { name: "{{ ansible_local.xci.network.xci_interface }}"   , bridge: "br-vlan"                 }
         - { name: "{{ ansible_local.xci.network.xci_interface }}.30", bridge: "br-vxlan"  , vlan_id: 30 }
     - name: Configure networking on CentOS for bridges
       template:
-        src: "{{ ansible_os_family | lower }}/bridge.ifcfg.j2"
+        src: "{{ installer_type }}/{{ ansible_os_family | lower }}/bridge.ifcfg.j2"
         dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.name }}"
       with_items:
         - { name: "br-vlan"   , ip: "{{ host_info[inventory_hostname].VLAN_IP }}",    prefix: 24 }