Merge "Implement Workers parameters"
[apex-tripleo-heat-templates.git] / network / ports / ctlplane_vip.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   Creates a port for a VIP on the undercloud ctlplane network.
5   The IP address will be chosen automatically if FixedIPs is empty.
6
7 parameters:
8   NetworkName:
9     description: # Here for compatibility with isolated networks
10     default: ctlplane
11     type: string
12   PortName:
13     description: Name of the port
14     default: ''
15     type: string
16   ControlPlaneIP: # Here for compatibility with noop.yaml
17     description: IP address on the control plane
18     default: ''
19     type: string
20   ControlPlaneNetwork:
21     description: The name of the undercloud Neutron control plane
22     default: ctlplane
23     type: string
24   FixedIPs:
25     description: >
26         Control the IP allocation for the VIP port. E.g.
27         [{'ip_address':'1.2.3.4'}]
28     default: []
29     type: json
30
31 resources:
32   VipPort:
33     type: OS::Neutron::Port
34     properties:
35       network: {get_param: ControlPlaneNetwork}
36       name: {get_param: PortName}
37       fixed_ips: {get_param: FixedIPs}
38       replacement_policy: AUTO
39
40 outputs:
41   ip_address:
42     description: Virtual IP network IP
43     value: {get_attr: [VipPort, fixed_ips, 0, ip_address]}
44   ip_subnet:
45     # FIXME: this assumes a 2 digit subnet CIDR (need more heat functions?)
46     description: IP/Subnet CIDR for the ctlplane network.
47     value:
48           list_join:
49             - ''
50             - - {get_attr: [VipPort, fixed_ips, 0, ip_address]}
51               - '/'
52               - {get_attr: [VipPort, subnets, 0, cidr, -2]}
53               - {get_attr: [VipPort, subnets, 0, cidr, -1]}