Make all network ports type to consume FixedIPs
[apex-tripleo-heat-templates.git] / network / ports / tenant.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   Creates a port on the tenant network.
5
6 parameters:
7   TenantNetName:
8     description: Name of the tenant neutron network
9     default: tenant
10     type: string
11   PortName:
12     description: Name of the port
13     default: ''
14     type: string
15   ControlPlaneIP: # Here for compatability with noop.yaml
16     description: IP address on the control plane
17     type: string
18   FixedIPs:
19     description: >
20         Control the IP allocation for the VIP port. E.g.
21         [{'ip_address':'1.2.3.4'}]
22     default: []
23     type: json
24
25 resources:
26
27   TenantPort:
28     type: OS::Neutron::Port
29     properties:
30       network: {get_param: TenantNetName}
31       name: {get_param: PortName}
32       fixed_ips: {get_param: FixedIPs}
33       replacement_policy: AUTO
34
35 outputs:
36   ip_address:
37     description: tenant network IP
38     value: {get_attr: [TenantPort, fixed_ips, 0, ip_address]}
39   ip_subnet:
40     # FIXME: this assumes a 2 digit subnet CIDR (need more heat functions?)
41     description: IP/Subnet CIDR for the tenant network IP
42     value:
43           list_join:
44             - ''
45             - - {get_attr: [TenantPort, fixed_ips, 0, ip_address]}
46               - '/'
47               - {get_attr: [TenantPort, subnets, 0, cidr, -2]}
48               - {get_attr: [TenantPort, subnets, 0, cidr, -1]}