1 ##############################################################################
2 # Copyright (c) 2018 Canonical Ltd. and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {%- set net_config = conf.idf.net_config %}
15 - name: {{ conf.nodes[0].name }}
16 architecture: {{ conf.nodes[0].node.arch }}
17 roles: [network, control]
19 - ifname: {{ conf.nodes[0].interfaces[1].name }}{% if conf.nodes[0].interfaces[1].vlan | int > 0 %}.{{conf.nodes[0].interfaces[1].vlan}}{% endif %}
21 mac: ["{{ conf.nodes[0].interfaces[1].mac_address }}"]
22 - ifname: {{ conf.nodes[0].interfaces[2].name }}{% if conf.nodes[0].interfaces[2].vlan | int > 0 %}.{{conf.nodes[0].interfaces[2].vlan}}{% endif %}
24 mac: ["{{ conf.nodes[0].interfaces[2].mac_address }}"]
25 - ifname: {{ conf.nodes[0].interfaces[0].name }}{% if conf.nodes[0].interfaces[0].vlan | int > 0 %}.{{conf.nodes[0].interfaces[0].vlan}}{% endif %}
27 mac: ["{{ conf.nodes[0].interfaces[0].mac_address }}"]
28 - ifname: {{ conf.nodes[0].interfaces[3].name }}{% if conf.nodes[0].interfaces[3].vlan | int > 0 %}.{{conf.nodes[0].interfaces[3].vlan}}{% endif %}
30 mac: ["{{ conf.nodes[0].interfaces[3].mac_address }}"]
31 - ifname: {{ conf.nodes[0].interfaces[3].name }}
33 mac: ["{{ conf.nodes[0].interfaces[3].mac_address }}"]
35 type: {{ conf.nodes[0].remote_management.type }}
36 address: {{ conf.nodes[0].remote_management.address }}
37 user: {{ conf.nodes[0].remote_management.user }}
38 pass: {{ conf.nodes[0].remote_management.pass }}
39 - name: {{ conf.nodes[1].name }}
40 architecture: {{ conf.nodes[1].node.arch }}
41 roles: [compute, control, storage]
43 - ifname: {{ conf.nodes[1].interfaces[1].name }}{% if conf.nodes[1].interfaces[1].vlan | int > 0 %}.{{conf.nodes[1].interfaces[1].vlan}}{% endif %}
45 mac: ["{{ conf.nodes[1].interfaces[1].mac_address }}"]
46 - ifname: {{ conf.nodes[1].interfaces[2].name }}{% if conf.nodes[1].interfaces[2].vlan | int > 0 %}.{{conf.nodes[1].interfaces[2].vlan}}{% endif %}
48 mac: ["{{ conf.nodes[1].interfaces[2].mac_address }}"]
49 - ifname: {{ conf.nodes[1].interfaces[0].name }}{% if conf.nodes[1].interfaces[0].vlan | int > 0 %}.{{conf.nodes[1].interfaces[0].vlan}}{% endif %}
51 mac: ["{{ conf.nodes[1].interfaces[0].mac_address }}"]
52 - ifname: {{ conf.nodes[1].interfaces[3].name }}{% if conf.nodes[1].interfaces[3].vlan | int > 0 %}.{{conf.nodes[1].interfaces[3].vlan}}{% endif %}
54 mac: ["{{ conf.nodes[1].interfaces[3].mac_address }}"]
55 - ifname: {{ conf.nodes[1].interfaces[3].name }}
57 mac: ["{{ conf.nodes[1].interfaces[3].mac_address }}"]
59 type: {{ conf.nodes[1].remote_management.type }}
60 address: {{ conf.nodes[1].remote_management.address }}
61 user: {{ conf.nodes[1].remote_management.user }}
62 pass: {{ conf.nodes[1].remote_management.pass }}
63 - name: {{ conf.nodes[2].name }}
64 architecture: {{ conf.nodes[2].node.arch }}
65 roles: [compute, control, storage]
67 - ifname: {{ conf.nodes[2].interfaces[1].name }}{% if conf.nodes[2].interfaces[1].vlan | int > 0 %}.{{conf.nodes[2].interfaces[1].vlan}}{% endif %}
69 mac: ["{{ conf.nodes[2].interfaces[1].mac_address }}"]
70 - ifname: {{ conf.nodes[2].interfaces[2].name }}{% if conf.nodes[2].interfaces[2].vlan | int > 0 %}.{{conf.nodes[2].interfaces[2].vlan}}{% endif %}
72 mac: ["{{ conf.nodes[2].interfaces[2].mac_address }}"]
73 - ifname: {{ conf.nodes[2].interfaces[0].name }}{% if conf.nodes[2].interfaces[0].vlan | int > 0 %}.{{conf.nodes[2].interfaces[0].vlan}}{% endif %}
75 mac: ["{{ conf.nodes[2].interfaces[0].mac_address }}"]
76 - ifname: {{ conf.nodes[2].interfaces[3].name }}{% if conf.nodes[2].interfaces[3].vlan | int > 0 %}.{{conf.nodes[2].interfaces[3].vlan}}{% endif %}
78 mac: ["{{ conf.nodes[2].interfaces[3].mac_address }}"]
79 - ifname: {{ conf.nodes[2].interfaces[3].name }}
81 mac: ["{{ conf.nodes[2].interfaces[3].mac_address }}"]
83 type: {{ conf.nodes[2].remote_management.type }}
84 address: {{ conf.nodes[2].remote_management.address }}
85 user: {{ conf.nodes[2].remote_management.user }}
86 pass: {{ conf.nodes[2].remote_management.pass }}
87 - name: {{ conf.nodes[3].name }}
88 architecture: {{ conf.nodes[3].node.arch }}
89 roles: [compute, storage]
91 - ifname: {{ conf.nodes[3].interfaces[1].name }}{% if conf.nodes[3].interfaces[1].vlan | int > 0 %}.{{conf.nodes[3].interfaces[1].vlan}}{% endif %}
93 mac: ["{{ conf.nodes[3].interfaces[1].mac_address }}"]
94 - ifname: {{ conf.nodes[3].interfaces[2].name }}{% if conf.nodes[3].interfaces[2].vlan | int > 0 %}.{{conf.nodes[3].interfaces[2].vlan}}{% endif %}
96 mac: ["{{ conf.nodes[3].interfaces[2].mac_address }}"]
97 - ifname: {{ conf.nodes[3].interfaces[0].name }}{% if conf.nodes[3].interfaces[0].vlan | int > 0 %}.{{conf.nodes[3].interfaces[0].vlan}}{% endif %}
99 mac: ["{{ conf.nodes[3].interfaces[0].mac_address }}"]
100 - ifname: {{ conf.nodes[3].interfaces[3].name }}{% if conf.nodes[3].interfaces[3].vlan | int > 0 %}.{{conf.nodes[3].interfaces[3].vlan}}{% endif %}
102 mac: ["{{ conf.nodes[3].interfaces[3].mac_address }}"]
103 - ifname: {{ conf.nodes[3].interfaces[3].name }}
105 mac: ["{{ conf.nodes[3].interfaces[3].mac_address }}"]
107 type: {{ conf.nodes[3].remote_management.type }}
108 address: {{ conf.nodes[3].remote_management.address }}
109 user: {{ conf.nodes[3].remote_management.user }}
110 pass: {{ conf.nodes[3].remote_management.pass }}
111 - name: {{ conf.nodes[4].name }}
112 architecture: {{ conf.nodes[4].node.arch }}
113 roles: [compute, storage]
115 - ifname: {{ conf.nodes[4].interfaces[1].name }}{% if conf.nodes[4].interfaces[1].vlan | int > 0 %}.{{conf.nodes[4].interfaces[1].vlan}}{% endif %}
117 mac: ["{{ conf.nodes[4].interfaces[1].mac_address }}"]
118 - ifname: {{ conf.nodes[4].interfaces[2].name }}{% if conf.nodes[4].interfaces[2].vlan | int > 0 %}.{{conf.nodes[4].interfaces[2].vlan}}{% endif %}
120 mac: ["{{ conf.nodes[4].interfaces[2].mac_address }}"]
121 - ifname: {{ conf.nodes[4].interfaces[0].name }}{% if conf.nodes[4].interfaces[0].vlan | int > 0 %}.{{conf.nodes[4].interfaces[0].vlan}}{% endif %}
123 mac: ["{{ conf.nodes[4].interfaces[0].mac_address }}"]
124 - ifname: {{ conf.nodes[4].interfaces[3].name }}{% if conf.nodes[4].interfaces[3].vlan | int > 0 %}.{{conf.nodes[4].interfaces[3].vlan}}{% endif %}
126 mac: ["{{ conf.nodes[4].interfaces[3].mac_address }}"]
127 - ifname: {{ conf.nodes[1].interfaces[2].name }}
129 mac: ["{{ conf.nodes[4].interfaces[3].mac_address }}"]
131 type: {{ conf.nodes[4].remote_management.type }}
132 address: {{ conf.nodes[4].remote_management.address }}
133 user: {{ conf.nodes[4].remote_management.user }}
134 pass: {{ conf.nodes[4].remote_management.pass }}
135 floating-ip-range: 10.5.15.6,10.5.15.250,10.5.15.1,10.5.15.0/24
137 dns: {{ net_config.public.dns[0] }}
151 - type: admin # admin
152 bridge: {{ net_config.admin.bridge }} # admin bridge
153 cidr: {{ net_config.admin.network }}/{{ net_config.admin.mask }}
154 gateway: {{ net_config.admin.gateway }} # admin gateway
157 cidr: {{ net_config.mgmt.network }}/{{ net_config.mgmt.mask }}
160 - type: storage # storage
161 cidr: {{ net_config.storage.network }}/{{ net_config.storage.mask }}
164 - type: floating # private
165 bridge: {{ net_config.private.bridge }} # private bridge
166 cidr: {{ net_config.private.network }}/{{ net_config.private.mask }}
169 - type: public # public
170 cidr: {{ net_config.public.network }}/{{ net_config.public.mask }}
171 gateway: {{ net_config.public.gateway }}
172 vlan: {% if net_config.public.vlan | int > 0 %}{{ net_config.public.vlan }}{% endif %} # public vlan