Merge "Refactor setup_docker_host.sh as host_prep_tasks"
[apex-tripleo-heat-templates.git] / network / ports / port_from_pool.network.j2.yaml
1 heat_template_version: pike
2
3 description: >
4   Creates a port on the {{network.name}} network, using a map of IPs per role.
5   Each role has a map of IPs in <Role>IPs parameters, with a list of IPs by
6   network (lower_name or lower case). For example:
7   ControllerIPs:
8     external:
9     - 1.2.3.4 # First controller
10     - 1.2.3.5 # Second controller
11
12 parameters:
13   {{network.name}}NetName:
14     description: Name of the {{network.name}} neutron network
15     default: {{network.name_lower}}
16     type: string
17   PortName:
18     description: Name of the port
19     default: ''
20     type: string
21   ControlPlaneIP: # Here for compatibility with noop.yaml
22     description: IP address on the control plane
23     default: ''
24     type: string
25   ControlPlaneNetwork: # Here for compatibility with ctlplane_vip.yaml
26     description: The name of the undercloud Neutron control plane
27     default: ctlplane
28     type: string
29   IPPool: # Set in <Role>IPs map, see environments/ips-from-pool-all.yaml
30     default: {}
31     type: json
32   NodeIndex: # First node in the role will get first IP, and so on...
33     default: 0
34     type: number
35   {{network.name}}NetCidr:
36     default: {{network.ip_subnet}}
37     description: Cidr for the {{network.name_lower}} network.
38     type: string
39
40 outputs:
41   ip_address:
42     description: {{network.name}} network IP
43     value: {get_param: [IPPool, {get_param: {{network.name}}NetName}, {get_param: NodeIndex}]}
44   ip_address_uri:
45 {%- if network.ipv6 %}
46     description: {{network.name}} network IP (with brackets for IPv6 URLs)
47     value:
48           list_join:
49           - ''
50           - - '['
51             - {get_param: [IPPool, {get_param: {{network.name}}NetName}, {get_param: NodeIndex}]}
52             - ']'
53 {%- else %}
54     description: {{network.name}} network IP (for compatibility with {{network.name_lower}}_v6.yaml)
55     value: {get_param: [IPPool, {get_param: {{network.name}}NetName}, {get_param: NodeIndex}]}
56 {%- endif %}
57   ip_subnet:
58     description: IP/Subnet CIDR for the {{network.name}} network IP
59     value:
60       list_join:
61       - ''
62       - - {get_param: [IPPool, {get_param: {{network.name}}NetName}, {get_param: NodeIndex}]}
63         - '/'
64         - {str_split: ['/', {get_param: {{network.name}}NetCidr}, 1]}
65