Convert network templates to be rendered via j2
[apex-tripleo-heat-templates.git] / network / ports / net_ip_map.yaml
1 heat_template_version: pike
2
3 parameters:
4   ControlPlaneIp:
5     default: ''
6     type: string
7   ControlPlaneSubnetCidr: # Override this via parameter_defaults
8     default: '24'
9     description: The subnet CIDR of the control plane network.
10     type: string
11   ExternalIp:
12     default: ''
13     type: string
14   ExternalIpSubnet:
15     default: ''
16     type: string
17     description: IP address/subnet on the external network
18   ExternalIpUri:
19     default: ''
20     type: string
21     description: IP address with brackets in case of IPv6
22   InternalApiIp:
23     default: ''
24     type: string
25   InternalApiIpSubnet:
26     default: ''
27     type: string
28     description: IP address/subnet on the internal API network
29   InternalApiIpUri:
30     default: ''
31     type: string
32     description: IP address with brackets in case of IPv6
33   StorageIp:
34     default: ''
35     type: string
36   StorageIpSubnet:
37     default: ''
38     type: string
39     description: IP address/subnet on the storage network
40   StorageIpUri:
41     default: ''
42     type: string
43     description: IP address with brackets in case of IPv6
44   StorageMgmtIp:
45     default: ''
46     type: string
47   StorageMgmtIpSubnet:
48     default: ''
49     type: string
50     description: IP address/subnet on the storage mgmt network
51   StorageMgmtIpUri:
52     default: ''
53     type: string
54     description: IP address with brackets in case of IPv6
55   TenantIp:
56     default: ''
57     type: string
58   TenantIpSubnet:
59     default: ''
60     type: string
61     description: IP address/subnet on the tenant network
62   TenantIpUri:
63     default: ''
64     type: string
65     description: IP address with brackets in case of IPv6
66   ManagementIp:
67     default: ''
68     type: string
69   ManagementIpSubnet:
70     default: ''
71     type: string
72     description: IP address/subnet on the management network
73   ManagementIpUri:
74     default: ''
75     type: string
76     description: IP address with brackets in case of IPv6
77
78   InternalApiNetName:
79     default: internal_api
80     description: The name of the internal_api network.
81     type: string
82   ExternalNetName:
83     default: external
84     description: The name of the external network.
85     type: string
86   ManagementNetName:
87     default: management
88     description: The name of the management network.
89     type: string
90   StorageNetName:
91     default: storage
92     description: The name of the storage network.
93     type: string
94   StorageMgmtNetName:
95     default: storage_mgmt
96     description: The name of the storage_mgmt network.
97     type: string
98   TenantNetName:
99     default: tenant
100     description: The name of the tenant network.
101     type: string
102
103 resources:
104
105   NetIpMapValue:
106     type: OS::Heat::Value
107     properties:
108       type: json
109       value:
110         map_replace:
111           - ctlplane: {get_param: ControlPlaneIp}
112             external: {get_param: ExternalIp}
113             internal_api: {get_param: InternalApiIp}
114             storage: {get_param: StorageIp}
115             storage_mgmt: {get_param: StorageMgmtIp}
116             tenant: {get_param: TenantIp}
117             management: {get_param: ManagementIp}
118             ctlplane_subnet:
119               list_join:
120                 - ''
121                 - - {get_param: ControlPlaneIp}
122                   - '/'
123                   - {get_param: ControlPlaneSubnetCidr}
124             external_subnet: {get_param: ExternalIpSubnet}
125             internal_api_subnet: {get_param: InternalApiIpSubnet}
126             storage_subnet: {get_param: StorageIpSubnet}
127             storage_mgmt_subnet: {get_param: StorageMgmtIpSubnet}
128             tenant_subnet: {get_param: TenantIpSubnet}
129             management_subnet: {get_param: ManagementIpSubnet}
130             ctlplane_uri: {get_param: ControlPlaneIp}
131             external_uri: {get_param: ExternalIpUri}
132             internal_api_uri: {get_param: InternalApiIpUri}
133             storage_uri: {get_param: StorageIpUri}
134             storage_mgmt_uri: {get_param: StorageMgmtIpUri}
135             tenant_uri: {get_param: TenantIpUri}
136             management_uri: {get_param: ManagementIpUri}
137           - keys:
138               external: {get_param: ExternalNetName}
139               internal_api: {get_param: InternalApiNetName}
140               storage: {get_param: StorageNetName}
141               storage_mgmt: {get_param: StorageMgmtNetName}
142               tenant: {get_param: TenantNetName}
143               management: {get_param: ManagementNetName}
144               external_subnet:
145                 str_replace:
146                   template: NAME_subnet
147                   params:
148                     NAME: {get_param: ExternalNetName}
149               internal_api_subnet:
150                 str_replace:
151                   template: NAME_subnet
152                   params:
153                     NAME: {get_param: InternalApiNetName}
154               storage_subnet:
155                 str_replace:
156                   template: NAME_subnet
157                   params:
158                     NAME: {get_param: StorageNetName}
159               storage_mgmt_subnet:
160                 str_replace:
161                   template: NAME_subnet
162                   params:
163                     NAME: {get_param: StorageMgmtNetName}
164               tenant_subnet:
165                 str_replace:
166                   template: NAME_subnet
167                   params:
168                     NAME: {get_param: TenantNetName}
169               management_subnet:
170                 str_replace:
171                   template: NAME_subnet
172                   params:
173                     NAME: {get_param: ManagementNetName}
174               external_uri:
175                 str_replace:
176                   template: NAME_uri
177                   params:
178                     NAME: {get_param: ExternalNetName}
179               internal_api_uri:
180                 str_replace:
181                   template: NAME_uri
182                   params:
183                     NAME: {get_param: InternalApiNetName}
184               storage_uri:
185                 str_replace:
186                   template: NAME_uri
187                   params:
188                     NAME: {get_param: StorageNetName}
189               storage_mgmt_uri:
190                 str_replace:
191                   template: NAME_uri
192                   params:
193                     NAME: {get_param: StorageMgmtNetName}
194               tenant_uri:
195                 str_replace:
196                   template: NAME_uri
197                   params:
198                     NAME: {get_param: TenantNetName}
199               management_uri:
200                 str_replace:
201                   template: NAME_uri
202                   params:
203                     NAME: {get_param: ManagementNetName}
204
205 outputs:
206   net_ip_map:
207     description: >
208       A Hash containing a mapping of network names to assigned IPs
209       for a specific machine.
210     value: {get_attr: [NetIpMapValue, value]}