|
| 1 | +--- |
| 2 | +heat_template_version: pike |
| 3 | + |
| 4 | +description: > |
| 5 | + Heat stack template for a stack containing one Neutron port which is on |
| 6 | + a named network and subnet. A floating IP is created for the port. |
| 7 | + A second port is allocated on another network with SR-IOV port binding. |
| 8 | +
|
| 9 | +parameters: |
| 10 | + node_idx: |
| 11 | + type: number |
| 12 | + label: Node index within cluster group |
| 13 | + cluster_net: |
| 14 | + type: json |
| 15 | + label: Network names and subnets to which the nodes should be attached |
| 16 | + cluster_fips: |
| 17 | + type: json |
| 18 | + label: List of UUIDs of prealloacted floating IPs |
| 19 | + default: [] |
| 20 | + router_networks: |
| 21 | + type: json |
| 22 | + label: Permit host to route IP traffic from specific networks through this port |
| 23 | + default: [] |
| 24 | + |
| 25 | +conditions: |
| 26 | + security_groups_set: |
| 27 | + yaql: |
| 28 | + expression: $.data.cluster_net.containsKey('security_groups') |
| 29 | + data: |
| 30 | + cluster_net: { get_param: [ cluster_net, 0 ] } |
| 31 | + |
| 32 | +resources: |
| 33 | + |
| 34 | + port1: |
| 35 | + type: OS::Neutron::Port |
| 36 | + properties: |
| 37 | + network: { get_param: [ cluster_net, 0, net ] } |
| 38 | + security_groups: |
| 39 | + if: |
| 40 | + - security_groups_set |
| 41 | + - { get_param: [ cluster_net, 0, security_groups ] } |
| 42 | + - [] |
| 43 | + fixed_ips: |
| 44 | + - subnet_id: { get_param: [ cluster_net, 0, subnet ] } |
| 45 | + |
| 46 | + port2: |
| 47 | + type: OS::Neutron::Port |
| 48 | + properties: |
| 49 | + admin_state_up: True |
| 50 | + network: { get_param: [ cluster_net, 1, net ] } |
| 51 | + binding:vnic_type: direct |
| 52 | + security_groups: [] |
| 53 | + fixed_ips: |
| 54 | + - subnet_id: { get_param: [ cluster_net, 1, subnet ] } |
| 55 | + |
| 56 | + floating_ip: |
| 57 | + type: OS::Neutron::FloatingIP |
| 58 | + properties: |
| 59 | + floating_network: { get_param: [ cluster_net, 0, floating_net ] } |
| 60 | + |
| 61 | + floating_ip_association: |
| 62 | + type: OS::Neutron::FloatingIPAssociation |
| 63 | + properties: |
| 64 | + floatingip_id: { get_resource: floating_ip } |
| 65 | + port_id: { get_resource: port1 } |
| 66 | + |
| 67 | +outputs: |
| 68 | + OS::stack_id: |
| 69 | + description: The network list |
| 70 | + value: |
| 71 | + - port1: { get_resource: port1 } |
| 72 | + - port2: { get_resource: port2 } |
| 73 | + |
| 74 | + networks: |
| 75 | + description: The network list |
| 76 | + value: |
| 77 | + - port: { get_resource: port1 } |
| 78 | + - port: { get_resource: port2 } |
| 79 | + |
| 80 | + primary_ip: |
| 81 | + description: ID of the IP assigned on the named cluster network |
| 82 | + value: { get_attr: [ port1, fixed_ips, 0, ip_address ] } |
0 commit comments