summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorJulien <zhang.jun3g@zte.com.cn>2016-12-18 23:34:07 +0800
committerJulien <zhang.jun3g@zte.com.cn>2016-12-18 23:37:57 +0800
commitfa88d5974878a0cbe8ea03bae14a8714bafac624 (patch)
tree5d9c01f64f9c0ec6d5bd6be8baf406da96bb4650 /deploy
parent3069bb6ec1937cefbcf24af4460b72f0915b22f1 (diff)
fix interface definition in yml
1. use list for physic nics; 2. add physic and logic nic parameter in deploy.yml; 3. merge network plane in file deploy.yml and network.yml using the keywork *network plane name* for better usage; *network_map* will be deleted from the return result list in the future. Change-Id: Ia5f3277ec0fe864b7a523162d3b53d650e04e2a3 Signed-off-by: Julien <zhang.jun3g@zte.com.cn>
Diffstat (limited to 'deploy')
-rw-r--r--deploy/config/vm_environment/zte-virtual1/deploy.yml26
-rwxr-xr-xdeploy/get_conf.py7
2 files changed, 19 insertions, 14 deletions
diff --git a/deploy/config/vm_environment/zte-virtual1/deploy.yml b/deploy/config/vm_environment/zte-virtual1/deploy.yml
index 0cb8f62b..e12a981e 100644
--- a/deploy/config/vm_environment/zte-virtual1/deploy.yml
+++ b/deploy/config/vm_environment/zte-virtual1/deploy.yml
@@ -6,15 +6,17 @@ hosts:
ip: '192.168.122.152'
password: 'ossdbg1'
interface:
- - 'ens3':
- - name: 'MANAGEMENT'
- ip: '192.168.122.152'
- - name: 'PUBLICAPI'
- ip:
- - name: 'physnet1'
- ip:
- - name: 'STORAGE'
- ip:
- - 'ens8':
- - name: 'EXTERNAL'
- ip:
+ - phynic: 'ens3'
+ logic:
+ - name: 'MANAGEMENT'
+ ip: '192.168.122.152'
+ - name: 'PUBLICAPI'
+ ip:
+ - name: 'physnet1'
+ ip:
+ - name: 'STORAGE'
+ ip:
+ - phynic: 'ens8'
+ logic:
+ - name: 'EXTERNAL'
+ ip:
diff --git a/deploy/get_conf.py b/deploy/get_conf.py
index 309b331b..5ce9806b 100755
--- a/deploy/get_conf.py
+++ b/deploy/get_conf.py
@@ -41,10 +41,11 @@ def network(network=None):
@decorator_mk('hosts')
def interface(host=None):
- hostname = host.get('name', '')
interface = host.get('interface', '')
map = {}
- map[hostname] = interface
+ for k in interface:
+ for v in k['logic']:
+ map[v['name']] = {'ip': v['ip'], 'phynic': k['phynic']}
return map
@@ -85,5 +86,7 @@ def config(dha_file, network_file):
dha_config_parse(data, dha_file)
data = init(network_file)
network_map, vip = network_config_parse(data, network_file)
+ for k in host_interface_map:
+ host_interface_map[k].update(network_map[k])
return host_interface_map, host_role_map, \
host_ip_passwd_map, network_map, vip