diff options
Diffstat (limited to 'xci')
-rwxr-xr-x | xci/playbooks/dynamic_inventory.py | 8 | ||||
-rw-r--r-- | xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/xci/playbooks/dynamic_inventory.py b/xci/playbooks/dynamic_inventory.py index 7831d197..0ea35ff7 100755 --- a/xci/playbooks/dynamic_inventory.py +++ b/xci/playbooks/dynamic_inventory.py @@ -21,6 +21,12 @@ import json class XCIInventory(object): + """ + + Generates the ansible inventory based on the idf and pdf files provided + when executing the deployment script + + """ def __init__(self): super(XCIInventory, self).__init__() self.inventory = {} @@ -130,11 +136,11 @@ class XCIInventory(object): for network, ndata in idf['idf']['net_config'].items(): network_interface_num = idf['idf']['net_config'][network]['interface'] host_networks[hostname][network] = {} - host_networks[hostname][network]['dns'] = [] host_networks[hostname][network]['address'] = pdf_host_info['interfaces'][int(network_interface_num)]['address'] + "/" + str(ndata['mask']) if 'gateway' in ndata.keys(): host_networks[hostname][network]['gateway'] = str(ndata['gateway']) + "/" + str(ndata['mask']) if 'dns' in ndata.keys(): + host_networks[hostname][network]['dns'] = [] for d in ndata['dns']: host_networks[hostname][network]['dns'].append(str(d)) diff --git a/xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml b/xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml index 46f6e81f..176c7eb1 100644 --- a/xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml +++ b/xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml @@ -90,7 +90,7 @@ - "'opnfv' in inventory_hostname" - name: restart network service - shell: "/sbin/ip addr flush dev {{ item }} && /sbin/ifdown -a && /sbin/ifup -a" + shell: "/sbin/ip addr flush dev {{ item }}; /sbin/ifdown -a; /sbin/ifup -a" async: 15 poll: 0 with_items: |