diff options
author | julien zhang <zhang.jun3g@zte.com.cn> | 2018-01-14 01:45:12 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-01-14 01:45:12 +0000 |
commit | 0208c3e6d059f634513e4ad87b393ebb555f58bc (patch) | |
tree | 701d711ca6990b29a9693a205f5ab02b80f8dd0e /config | |
parent | e45d73d74eedecce7d04cc8a76c18a9dd66a3b04 (diff) | |
parent | 101248f0920dca5ff6662266681c9f64d09a00c1 (diff) |
Merge "support gen DHA/NETWORK yaml by pdf"
Diffstat (limited to 'config')
-rw-r--r-- | config/installers/daisy/network-dpdk.yaml.j2 | 109 | ||||
-rw-r--r-- | config/installers/daisy/pod_config.yaml.j2 | 29 |
2 files changed, 29 insertions, 109 deletions
diff --git a/config/installers/daisy/network-dpdk.yaml.j2 b/config/installers/daisy/network-dpdk.yaml.j2 deleted file mode 100644 index ccd7c8c5..00000000 --- a/config/installers/daisy/network-dpdk.yaml.j2 +++ /dev/null @@ -1,109 +0,0 @@ -############################################################################## -# Copyright (c) 2017 ZTE Corporation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -############################################################################## -# Description -# MANAGEMENT: used for management -# STORAGE: used for storage access -# EXTERNAL: tenant public/floating IP associated network -# PUBLICAPI: used for horizon access, openstack API access -# TENANT: used for tenant access, vlan and VxLan supported, default VxLan -# HEARTBEAT: used for heartbeat, requires a dedicated interface -############################################################################## - ---- - -network-config-metadata: - title: 'Deployment Adapter for baremetal POD' - version: '0.1' - created: 'Nov 22 2017' - comment: 'For Daisy initial' - -{%- set mapping = {'HEARTBEAT': 'admin', - 'MANAGEMENT': 'mgmt', - 'PUBLICAPI': 'mgmt', - 'STORAGE': 'storage', - 'TENANT': 'public', - 'EXTERNAL': 'public'} -%} - -{%- if "idf" in conf and ("daisy" in conf["idf"] or "fuel" in conf["idf"]) -%} - {%- if "daisy" in conf["idf"] -%} - {%- set installer = "daisy" -%} - {%- else -%} - {%- set installer = "fuel" -%} - {%- endif %} - -networks: - - {%- set nodes_num = conf['nodes'] | length -%} - {%- set networks = {} -%} - {%- for key in mapping -%} - {%- set net_data = conf['net_config'][mapping[key]] -%} - {%- set interface = net_data['interface'] -%} - {%- set interface_name = conf.idf[installer].network.node[0].interfaces[interface] -%} - {%- set bus_addr = conf.idf[installer].network.node[0].busaddr[interface] -%} - {%- set vlan = net_data['vlan'] -%} - {%- if vlan == "native" or vlan == None -%} - {%- set vlan = "null" -%} - {%- endif -%} - {%- set network = net_data['network'] -%} - {%- set ips = network.split(".") -%} - {%- set mask = net_data['mask'] -%} - {%- if 'ip-range' in net_data -%} - {%- set ip_range = net_data['ip-range'] -%} - {%- set (start, end) = ip_range.split("-") -%} - {%- else -%} - {%- set start = ".".join([ips[0], ips[1], ips[2], "10"]) -%} - {%- set end = ".".join([ips[0], ips[1], ips[2], "200"]) -%} - {%- endif -%} - {%- set vip = start.split(".")[3] | int -%} - {%- set vip = vip + nodes_num + 10 - (vip + nodes_num) % 10 -%} - {%- set vip = ".".join([ips[0], ips[1], ips[2], vip | string]) -%} - - {%- if 'gateway' in net_data -%} - {%- set gateway = net_data.gateway -%} - {%- else -%} - {%- set gateway = ".".join([ips[0], ips[1], ips[2], "1"]) -%} - {%- endif -%} - - {%- set networks = networks.update({key: {'interface_name': interface_name, - 'bus_addr': bus_addr, - 'vlan': vlan, - 'network': network, - 'mask': mask, - 'start': start, - 'end': end, - 'vip': vip, - 'gateway': gateway - } - }) %} - - - cidr: '{{ network }}/{{ mask }}' - gateway: '{{ gateway }}' - ip_ranges: - - 'start': '{{ start }}' - 'end': '{{ end }}' - vlan_id: {{ vlan }} - name: '{{ key }}' - {%- if key == 'EXTERNAL' %} - network_name: 'admin_external' - mapping: 'physnet1' - {%- endif -%} - {%- endfor %} - -interfaces: - {%- for key in mapping %} - - name: '{{ key }}' - interface: '{{ networks[key].interface_name }}' - {%- endfor %} - -internal_vip: '{{ networks['MANAGEMENT'].vip }}' -public_vip: '{{ networks['PUBLICAPI'].vip }}' - -{%- endif %} diff --git a/config/installers/daisy/pod_config.yaml.j2 b/config/installers/daisy/pod_config.yaml.j2 index 776d2ecf..3e4ab106 100644 --- a/config/installers/daisy/pod_config.yaml.j2 +++ b/config/installers/daisy/pod_config.yaml.j2 @@ -11,6 +11,8 @@ adapter: {{ conf['jumphost']['remote_params']['type'] }} hosts: + {%- set nodes_num = conf['nodes'] | length -%} + {%- if nodes_num == 5 %} - name: 'controller01' roles: - 'CONTROLLER_LB' @@ -51,6 +53,33 @@ hosts: ipmi_pass: {{ conf['nodes'][4]['remote_management']['pass'] }} mac_addresses:{% for nic in conf['nodes'][4]['interfaces'] %} - {{ nic['mac_address'] }}{% endfor %} + {%- endif %} + {%- if nodes_num == 3 %} + - name: 'controller01' + roles: + - 'CONTROLLER_LB' + ipmi_ip: {{ conf['nodes'][0]['remote_management']['address'] }} + ipmi_user: {{ conf['nodes'][0]['remote_management']['user'] }} + ipmi_pass: {{ conf['nodes'][0]['remote_management']['pass'] }} + mac_addresses:{% for nic in conf['nodes'][0]['interfaces'] %} + - {{ nic['mac_address'] }}{% endfor %} + - name: 'computer01' + roles: + - 'COMPUTER' + ipmi_ip: {{ conf['nodes'][1]['remote_management']['address'] }} + ipmi_user: {{ conf['nodes'][1]['remote_management']['user'] }} + ipmi_pass: {{ conf['nodes'][1]['remote_management']['pass'] }} + mac_addresses:{% for nic in conf['nodes'][1]['interfaces'] %} + - {{ nic['mac_address'] }}{% endfor %} + - name: 'computer02' + roles: + - 'COMPUTER' + ipmi_ip: {{ conf['nodes'][2]['remote_management']['address'] }} + ipmi_user: {{ conf['nodes'][2]['remote_management']['user'] }} + ipmi_pass: {{ conf['nodes'][2]['remote_management']['pass'] }} + mac_addresses:{% for nic in conf['nodes'][2]['interfaces'] %} + - {{ nic['mac_address'] }}{% endfor %} + {%- endif %} disks: daisy: 50 daisy_passwd: 'r00tme' |