Convert PublicVirtualIP to new port creation method
[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 compatability with noop.yaml
17     description: IP address on the control plane
18     type: string
19   ControlPlaneNetwork:
20     description: The name of the undercloud Neutron control plane
21     default: ctlplane
22     type: string
23   FixedIPs:
24     description: >
25         Control the IP allocation for the VIP port. E.g.
26         [{'ip_address':'1.2.3.4'}]
27     default: []
28     type: json
29
30 resources:
31   VipPort:
32     type: OS::Neutron::Port
33     properties:
34       network: {get_param: ControlPlaneNetwork}
35       name: {get_param: PortName}
36       fixed_ips: {get_param: FixedIPs}
37       replacement_policy: AUTO
38
39 outputs:
40   ip_address:
41     description: Virtual IP network IP
42     value: {get_attr: [VipPort, fixed_ips, 0, ip_address]}
43   ip_subnet:
44     # FIXME: this assumes a 2 digit subnet CIDR (need more heat functions?)
45     description: IP/Subnet CIDR for the ctlplane network.
46     value:
47           list_join:
48             - ''
49             - - {get_attr: [VipPort, fixed_ips, 0, ip_address]}
50               - '/'
51               - {get_attr: [VipPort, subnets, 0, cidr, -2]}
52               - {get_attr: [VipPort, subnets, 0, cidr, -1]}