Modify idf to be aligned with the rest of idfs 95/60895/9
authorManuel Buil <mbuil@suse.com>
Mon, 13 Aug 2018 13:43:34 +0000 (15:43 +0200)
committerManuel Buil <mbuil@suse.com>
Tue, 21 Aug 2018 15:08:36 +0000 (15:08 +0000)
Change our idf to be more aligned with lf's idf. Adapt
dynamic_inventory.py to the change

Change-Id: Ib8f6d1684a00a8eb5ae06d5d04d308d4325cd444
Signed-off-by: Manuel Buil <mbuil@suse.com>
xci/playbooks/dynamic_inventory.py
xci/var/idf.yml

index bf9483d..aee2a87 100755 (executable)
@@ -93,15 +93,15 @@ class XCIInventory(object):
                 print(e)
                 sys.exit(1)
 
-        valid_host = (host for host in idf['xci'][self.installer]['nodes_roles'] \
+        valid_host = (host for host in idf['xci']['installers'][self.installer]['nodes_roles'] \
                       if host in idf['xci']['flavors'][self.flavor] \
                       and host != 'opnfv')
 
         for host in valid_host:
             nodes.append(host)
-            hostname = idf['xci'][self.installer]['hostnames'][host]
+            hostname = idf['xci']['installers'][self.installer]['hostnames'][host]
             self.add_host(hostname)
-            for role in idf['xci'][self.installer]['nodes_roles'][host]:
+            for role in idf['xci']['installers'][self.installer]['nodes_roles'][host]:
                 self.add_to_group(role, hostname)
 
             pdf_host_info = filter(lambda x: x['name'] == host, pdf['nodes'])[0]
@@ -124,8 +124,8 @@ class XCIInventory(object):
             self.add_groupvar('all', 'host_info', host_networks)
 
         # Now add the additional groups
-        for parent in idf['xci'][self.installer]['groups'].keys():
-            map(lambda x: self.add_group(x, parent), idf['xci'][self.installer]['groups'][parent])
+        for parent in idf['xci']['installers'][self.installer]['groups'].keys():
+            map(lambda x: self.add_group(x, parent), idf['xci']['installers'][self.installer]['groups'][parent])
 
         # Read additional group variables
         self.read_additional_group_vars()
index 4d743cd..7f2dbf3 100644 (file)
@@ -30,29 +30,7 @@ idf:
       interface: 3
       network: 172.29.244.0
       mask: 22
-
-xci:
-  pod_name: vpod1
-  net_config: *net_config
-  flavors:
-    mini:
-      - opnfv
-      - node1
-      - node2
-    noha:
-      - opnfv
-      - node1
-      - node2
-      - node3
-    ha:
-      - opnfv
-      - node1
-      - node2
-      - node3
-      - node4
-      - node5
-
-  osa:
+  osa: &idf_osa
     nodes_roles:
       opnfv: [deployment]
       node1: [controller]
@@ -72,9 +50,20 @@ xci:
       node3: compute01
       node4: controller01
       node5: controller02
-  kubespray:
+    network:
+      # network mapping
+      network_mapping:
+        # Management network used by installer components to communicate
+        net-mgmt: admin
+        # Storage Network
+        net-storage: storage
+        # Internal network for communication between VNF
+        net-internal: private
+        # Public network for VNF remote acces (ext-net in Openstack)
+        net-vnf: public
+  kubespray: &idf_kubespray
     nodes_roles:
-      opnvf: [opnfv]
+      opnfv: [opnfv]
       node1: [kube-master, etcd, vault]
       node2: [kube-node]
       node3: [kube-node]
@@ -91,7 +80,26 @@ xci:
       node3: node2
       node4: master2
       node5: master3
-
+xci:
+  pod_name: vpod1
+  net_config: *net_config
+  flavors:
+    mini:
+      - opnfv
+      - node1
+      - node2
+    noha:
+      - opnfv
+      - node1
+      - node2
+      - node3
+    ha:
+      - opnfv
+      - node1
+      - node2
+      - node3
+      - node4
+      - node5
   # net_config network to be used by the PXE
   pxe_network: public
 
@@ -104,13 +112,6 @@ xci:
   extra_addresses:
     opnfv: 192.168.122.2
 
-  # network mapping
-  network_mapping:
-    # Management network used by installer components to communicate
-    net-mgmt: admin
-    # Storage Network
-    net-storage: storage
-    # Internal network for communication between VNF
-    net-internal: private
-    # Public network for VNF remote acces (ext-net in Openstack)
-    net-vnf: public
+  installers:
+    osa: *idf_osa
+    kubespray: *idf_kubespray