Browse Source

Merge "Set default for network.ip_subnet"

changes/10/795010/1
Zuul 1 week ago
committed by Gerrit Code Review
parent
commit
cf3dcef5e0
2 changed files with 17 additions and 11 deletions
  1. +13
    -10
      network/network.j2
  2. +4
    -1
      network/ports/port_from_pool.j2

+ 13
- 10
network/network.j2 View File

@ -1,3 +1,6 @@
{%- if ipv6_override is not defined %}
{%- set ipv6_override = false %}
{%- endif %}
heat_template_version: wallaby
description: >
@ -6,7 +9,7 @@ description: >
parameters:
# the defaults here work for static IP assignment (IPAM) only
{{network.name}}NetCidr:
{%- if network.ipv6 or ipv6_override %}
{%- if network.ipv6|default(false) or ipv6_override %}
default: "{{network.ipv6_subnet|default(network.ip_subnet|default(""))}}"
{%- else %}
default: "{{network.ip_subnet|default("")}}"
@ -38,14 +41,14 @@ parameters:
description: The name of the {{network.name_lower}} subnet in Neutron.
type: string
{{network.name}}AllocationPools:
{%- if ":" in network.ip_subnet or network.ipv6 or ipv6_override %}
{%- if ":" in network.ip_subnet|default("") or network.ipv6|default(false) or ipv6_override %}
default: {{network.ipv6_allocation_pools|default(network.allocation_pools|default([]))}}
{%- else %}
default: {{network.allocation_pools|default([])}}
{%- endif %}
description: Ip allocation pool range for the {{network.name_lower}} network.
type: json
{%- if ":" in network.ip_subnet or network.ipv6 or ipv6_override %}
{%- if ":" in network.ip_subnet|default("") or network.ipv6|default(false) or ipv6_override %}
IPv6AddressMode:
default: dhcpv6-stateful
description: Neutron subnet IPv6 address mode
@ -56,7 +59,7 @@ parameters:
type: string
{%- endif %}
{{network.name}}InterfaceDefaultRoute:
{%- if network.ipv6 or ipv6_override %}
{%- if network.ipv6|default(false) or ipv6_override %}
default: "{{network.gateway_ipv6|default(network.gateway_ip|default(''))}}"
{%- else %}
default: "{{network.gateway_ip|default('')}}"
@ -83,7 +86,7 @@ parameters:
type: number
{%- for subnet in network.subnets|default({}) if network.subnets[subnet].enabled|default(true) %}
{{network.name}}SubnetCidr_{{subnet}}:
{%- if network.ipv6 or ipv6_override %}
{%- if network.ipv6|default(false) or ipv6_override %}
default: "{{network.subnets[subnet]['ipv6_subnet']|default(network.subnets[subnet]['ip_subnet']|default(""))}}"
{%- else %}
default: "{{network.subnets[subnet]['ip_subnet']|default("")}}"
@ -92,7 +95,7 @@ parameters:
Cidr for the {{network.name_lower}} network's {{subnet}} subnet.
type: string
{{network.name}}AllocationPools_{{subnet}}:
{%- if ":" in network.subnets[subnet]['ip_subnet'] or network.ipv6 or ipv6_override %}
{%- if ":" in network.subnets[subnet]['ip_subnet'] or network.ipv6|default(false) or ipv6_override %}
default: {{network.subnets[subnet]['ipv6_allocation_pools']|default(network.subnets[subnet]['allocation_pools']|default([]))}}
{%- else %}
default: {{network.subnets[subnet]['allocation_pools']|default([])}}
@ -101,7 +104,7 @@ parameters:
Ip allocation pool range for the {{network.name_lower}} network's {{subnet}} subnet.
type: json
{{network.name}}InterfaceDefaultRoute_{{subnet}}:
{%- if ":" in network.subnets[subnet]['ip_subnet'] or network.ipv6 or ipv6_override %}
{%- if ":" in network.subnets[subnet]['ip_subnet'] or network.ipv6|default(false) or ipv6_override %}
default: "{{network.subnets[subnet]['gateway_ipv6']|default(network.subnets[subnet]['gateway_ip']|default([]))}}"
{%- else %}
default: "{{network.subnets[subnet]['gateway_ip']|default([])}}"
@ -184,7 +187,7 @@ resources:
{%- if network.service_net_map_replace|default('') %}
- tripleo_service_net_map_replace={{network.service_net_map_replace}}
{%- endif %}
{%- if network.ipv6 or ipv6_override %}
{%- if network.ipv6|default(false) or ipv6_override %}
- tripleo_ipv6=true
{%- endif %}
@ -205,7 +208,7 @@ resources:
# All networks have an implicit network segment when created, map this subnet to that segment.
segment: {get_attr: [{{network.name}}Network, segments, 0, id]}
ip_version: {if: [is_ipv6, 6, 4]}
{%- if ":" in network.ip_subnet or network.ipv6 or ipv6_override %}
{%- if ":" in network.ip_subnet|default("") or network.ipv6|default(false) or ipv6_override %}
ipv6_address_mode: {get_param: IPv6AddressMode}
ipv6_ra_mode: {get_param: IPv6RAMode}
{%- else %}
@ -253,7 +256,7 @@ resources:
host_routes: {get_param: {{network.name}}Routes_{{subnet}}}
segment: {get_resource: {{network.name}}Segment_{{subnet}}}
ip_version: {if: [is_ipv6, 6, 4]}
{%- if ":" in network.ip_subnet or network.ipv6 or ipv6_override %}
{%- if ":" in network.ip_subnet|default("") or network.ipv6|default(false) or ipv6_override %}
ipv6_address_mode: {get_param: IPv6AddressMode}
ipv6_ra_mode: {get_param: IPv6RAMode}
{%- else %}


+ 4
- 1
network/ports/port_from_pool.j2 View File

@ -1,3 +1,6 @@
{%- if ipv6_override is not defined %}
{%- set ipv6_override = false %}
{%- endif %}
heat_template_version: wallaby
description: >
@ -53,7 +56,7 @@ parameters:
default: 0
type: number
{{network.name}}NetCidr:
{%- if network.ipv6 or ipv6_override %}
{%- if network.ipv6|default(false) or ipv6_override %}
default: "{{network.ipv6_subnet|default(network.ip_subnet|default(""))}}"
{%- else %}
default: "{{network.ip_subnet|default("")}}"


Loading…
Cancel
Save