aboutsummaryrefslogtreecommitdiffstats
path: root/network/network.network.j2.yaml
diff options
context:
space:
mode:
authorDan Sneddon <dsneddon@redhat.com>2017-08-30 11:26:52 -0700
committerEmilien Macchi <emilien@redhat.com>2017-09-01 17:59:24 +0000
commitd88a8dc52ab4331a45a0cd92cf886274cccea73c (patch)
tree752cf12c4f8f02ec8f595c4f6005156e9495c867 /network/network.network.j2.yaml
parenta3ee4adaee3d59a4cc53daa4b7b5e1d517d4458c (diff)
Remove ipv6 specific network templates
This change renders the IPv6 versions of the isolated networks using j2. To allow for backward compatibility, there will be 2 versions of the network definitions, <network>.yaml and <network>_v6.yaml. If the ip_subnet contains an IPv6 address, or if ipv6: true is set on the network definition in network_data.yaml, then the <network>.yaml version will contain an IPv6 definition, otherwise the <network>.yaml will be IPv4, and the <network>_v6.yaml will be IPv6. In a future follow-up patch, we will probably only create the required versions of the networks, either IPv4, IPv6, not both. The ipv6_subnet, ipv6_allocation_pools, and ipv6_gateway settings in the network_data.yaml definition file are used for the <network>_v6.yaml network definition. Note that these subnet/cidr/gateway definitions only set the defaults, which can be overridden with parameters set in an environment file. Since the parameters for IP and subnet range are the same (e.g. InternalApiNetCidr applies to both IPv4/v6), only one version can be used at a time. If an operator wishes to use dual-stack IPv4/IPv6, then two different networks should be created, and both networks can be applied to a single interface. Note that the workflow for the operator is the same as before this change, but a new example template has been added to environments/network-environment-v6.yaml. Change-Id: I0e674e4b1e43786717ae6416571dde3a0e11a5cc Partially-Implements: blueprint composable-networks Closes-bug: 1714115 (cherry picked from commit dd299f08bd6b1df43760148d83ce9b6e09ba6572)
Diffstat (limited to 'network/network.network.j2.yaml')
-rw-r--r--network/network.network.j2.yaml92
1 files changed, 1 insertions, 91 deletions
diff --git a/network/network.network.j2.yaml b/network/network.network.j2.yaml
index 29d58cd5..d9ff6169 100644
--- a/network/network.network.j2.yaml
+++ b/network/network.network.j2.yaml
@@ -1,91 +1 @@
-heat_template_version: pike
-
-description: >
- {{network.name}} network definition (automatically generated).
-
-parameters:
- # the defaults here work for static IP assignment (IPAM) only
- {{network.name}}NetCidr:
- default: {{network.ip_subnet|default("")}}
- description: Cidr for the {{network.name_lower}} network.
- type: string
- {{network.name}}NetValueSpecs:
- default: {'provider:physical_network': '{{network.name_lower}}', 'provider:network_type': 'flat'}
- description: Value specs for the {{network.name_lower}} network.
- type: json
- {{network.name}}NetAdminStateUp:
- default: false
- description: The admin state of the network.
- type: boolean
- {{network.name}}NetEnableDHCP:
- default: false
- description: Whether to enable DHCP on the associated subnet.
- type: boolean
- {{network.name}}NetShared:
- default: false
- description: Whether this network is shared across all tenants.
- type: boolean
- {{network.name}}NetName:
- default: {{network.name_lower}}
- description: The name of the {{network.name_lower}} network.
- type: string
- {{network.name}}SubnetName:
- default: {{network.name_lower}}_subnet
- description: The name of the {{network.name_lower}} subnet in Neutron.
- type: string
- {{network.name}}AllocationPools:
- default: {{network.allocation_pools|default([])}}
- description: Ip allocation pool range for the {{network.name_lower}} network.
- type: json
- {{network.name}}InterfaceDefaultRoute:
- default: {{network.gateway_ip|default('""')}}
- description: default route for the {{network.name_lower}} network
- type: string
-{%- if network.vlan %}
- {{network.name}}NetworkVlanID:
- default: {{network.vlan}}
- description: Vlan ID for the {{network.name}} network traffic.
- type: number
-{%- endif %}
-{%- if network.ipv6 %}
- IPv6AddressMode:
- default: dhcpv6-stateful
- description: Neutron subnet IPv6 address mode
- type: string
- IPv6RAMode:
- default: dhcpv6-stateful
- description: Neutron subnet IPv6 router advertisement mode
- type: string
-{%- endif %}
-
-resources:
- {{network.name}}Network:
- type: OS::Neutron::Net
- properties:
- admin_state_up: {get_param: {{network.name}}NetAdminStateUp}
- name: {get_param: {{network.name}}NetName}
- shared: {get_param: {{network.name}}NetShared}
- value_specs: {get_param: {{network.name}}NetValueSpecs}
-
- {{network.name}}Subnet:
- type: OS::Neutron::Subnet
- properties:
- cidr: {get_param: {{network.name}}NetCidr}
- name: {get_param: {{network.name}}SubnetName}
- network: {get_resource: {{network.name}}Network}
- allocation_pools: {get_param: {{network.name}}AllocationPools}
- gateway_ip: {get_param: {{network.name}}InterfaceDefaultRoute}
-{%- if network.ipv6 %}
- ip_version: 6
- ipv6_address_mode: {get_param: IPv6AddressMode}
- ipv6_ra_mode: {get_param: IPv6RAMode}
-{%- else %}
- enable_dhcp: {get_param: {{network.name}}NetEnableDHCP}
-{%- endif %}
-
-outputs:
- OS::stack_id:
- description: {{network.name_lower}} network
- value: {get_resource: {{network.name}}Network}
- subnet_cidr:
- value: {get_attr: [{{network.name}}Subnet, cidr]}
+{% include 'network.j2' %}