#read the value from deployment.yaml
if [ -e ~/.juju/deployment.yaml ]; then
- extport=`grep "ext-port" deployment.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
+
+ cp ~/.juju/deployment.yaml ./deployment.yaml
+ cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
+
+ extport=`grep "ext-port" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
sed --i "s@#ext-port: \"eth1\"@ext-port: \"$extport\"@g" ./bundles.yaml
- datanet=`grep "dataNetwork" deployment.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
+ datanet=`grep "dataNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
sed --i "s@#os-data-network: 10.4.8.0/21@os-data-network: $datanet@g" ./bundles.yaml
- admnet=`grep "admNetwork" deployment.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
+ admnet=`grep "admNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
sed --i "s@10.4.1.1@$admnet@g" ./bundles.yaml
- cephdisk=`grep "disk" deployment.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
+ cephdisk=`grep "disk" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
sed --i "s@osd-devices: /srv@osd-devices: $cephdisk@g" ./bundles.yaml
fi
labcfg = yaml.load(labf)
opnfvcfg={}
+opnfvlabcfg={}
def getFromDict(dataDict, mapList):
return reduce(lambda d, k: d[k], mapList, dataDict)
}\
}
-opnfvcfg['opnfv']={'ext-port':'','floating-ip-range':'','dataNetwork':'','ceph-disk':'/srv/'}
+opnfvlabcfg['opnfv']={'ext-port':'','floating-ip-range':'','dataNetwork':'','ceph-disk':'/srv/'}
opnfvcfg['demo-maas']['maas']['apt_sources'].append("ppa:maas/stable")
opnfvcfg['demo-maas']['maas']['apt_sources'].append("ppa:juju/stable")
ethbrAdmin = getFromDict(labcfg, ["opnfv","spaces",c,"bridge"])
brgway = getFromDict(labcfg, ["opnfv","spaces",c,"gateway"])
tmpcidr = brcidr[:-4]
- opnfvcfg["opnfv"]["admNetwork"]=tmpcidr+"2"
+ opnfvlabcfg["opnfv"]["admNetwork"]=tmpcidr+"2"
nodegroup={"device": "eth"+str(y), "ip": tmpcidr+"5","subnet_mask": "255.255.255.0", \
"broadcast_ip": tmpcidr+"255", "router_ip": brgway,\
' netmask 255.255.255.0\n')
opnfvcfg["demo-maas"]["juju-bootstrap"]["interfaces"].append("bridge="+brname+",model=virtio")
if brtype == "data":
- opnfvcfg["opnfv"]["dataNetwork"]=brcidr
+ opnfvlabcfg["opnfv"]["dataNetwork"]=brcidr
c=c+1
c=c+1
-opnfvcfg["opnfv"]["floating-ip-range"]=labcfg["lab"]["racks"][0]["floating-ip-range"]
-opnfvcfg["opnfv"]["ext-port"]=labcfg["lab"]["racks"][0]["ext-port"]
-opnfvcfg["opnfv"]["ceph-disk"]=labcfg["opnfv"]["storage"][0]["disk"]
+opnfvlabcfg["opnfv"]["floating-ip-range"]=labcfg["lab"]["racks"][0]["floating-ip-range"]
+opnfvlabcfg["opnfv"]["ext-port"]=labcfg["lab"]["racks"][0]["ext-port"]
+opnfvlabcfg["opnfv"]["ceph-disk"]=labcfg["opnfv"]["storage"][0]["disk"]
with open('deployment.yaml', 'wa') as opnfvf:
yaml.dump(opnfvcfg, opnfvf, default_flow_style=False)
+with open('deployconfig.yaml', 'wa') as opnfvf:
+ yaml.dump(opnfvlabcfg, opnfvf, default_flow_style=False)