Merge "Iterate once in network-environment.yaml"

This commit is contained in:
Zuul 2018-07-14 02:36:25 +00:00 committed by Gerrit Code Review
commit 70f94be2e5
2 changed files with 41 additions and 51 deletions

View File

@ -21,37 +21,31 @@ parameter_defaults:
# Gateway router for the provisioning network (or Undercloud IP) # Gateway router for the provisioning network (or Undercloud IP)
ControlPlaneDefaultRoute: 192.168.24.254 ControlPlaneDefaultRoute: 192.168.24.254
EC2MetadataIp: 192.168.24.1 # Generally the IP of the Undercloud EC2MetadataIp: 192.168.24.1 # Generally the IP of the Undercloud
{% for network in networks if network.enabled|default(true) %}
{%- if network.name != 'Tenant' %}
# Customize the IP subnets to match the local environment # Customize the IP subnets to match the local environment
{%- for network in networks if network.enabled|default(true) %}
{%- if network.name != 'Tenant' %}
{{network.name}}NetCidr: '{{network.ipv6_subnet}}' {{network.name}}NetCidr: '{{network.ipv6_subnet}}'
{%- else %} # Customize the IP range to use for static IPs and VIPs
# Tenant tunneling network is IPv4 until IPv6 is fully supported {%- if network.name == 'External' %}
{{network.name}}NetCidr: '{{network.ip_subnet}}'
{%- endif %}
{%- endfor %}
# Customize the VLAN IDs to match the local environment
{%- for network in networks if network.enabled|default(true) %}
{%- if network.vlan is defined %}
{{network.name}}NetworkVlanID: {{network.vlan}}
{%- endif %}
{%- endfor %}
# Customize the IP ranges on each network to use for static IPs and VIPs
{%- for network in networks if network.enabled|default(true) %}
{%- if network.name == 'External' %}
# Leave room if the external network is also used for floating IPs # Leave room if the external network is also used for floating IPs
{%- endif %} {%- endif %}
{%- if network.name != 'Tenant' %}
{{network.name}}AllocationPools: {{network.ipv6_allocation_pools}} {{network.name}}AllocationPools: {{network.ipv6_allocation_pools}}
{%- else %} {%- else %}
# Tenant tunneling network should be IPv4 # Tenant tunneling network is IPv4 until IPv6 is fully supported
{{network.name}}AllocationPools: {{network.ip_allocation_pools}} # Customize the IP subnets to match the local environment
{%- endif %} {{network.name}}NetCidr: '{{network.ip_subnet}}'
{%- endfor %} # Customize the IP range to use for static IPs and VIPs
# Gateway routers for routable networks {{network.name}}AllocationPools: {{network.allocation_pools}}
{%- for network in networks if network.enabled|default(true) and network.gateway_ipv6|default(false) %} {%- endif %}
{%- if network.enabled|default(true) and network.gateway_ipv6|default(false) %}
# Gateway router for routable networks
{{network.name}}InterfaceDefaultRoute: '{{network.gateway_ipv6}}' {{network.name}}InterfaceDefaultRoute: '{{network.gateway_ipv6}}'
{%- endfor %} {%- endif %}
{%- if network.vlan is defined %}
# Customize the VLAN ID to match the local environment
{{network.name}}NetworkVlanID: {{network.vlan}}
{%- endif %}
{% endfor %}
{#- FIXME: These global parameters should be defined in a YAML file, e.g. network_data.yaml. #} {#- FIXME: These global parameters should be defined in a YAML file, e.g. network_data.yaml. #}
# Define the DNS servers (maximum 2) for the overcloud nodes # Define the DNS servers (maximum 2) for the overcloud nodes
DnsServers: ["8.8.8.8","8.8.4.4"] DnsServers: ["8.8.8.8","8.8.4.4"]

View File

@ -17,38 +17,34 @@ parameter_defaults:
# Gateway router for the provisioning network (or Undercloud IP) # Gateway router for the provisioning network (or Undercloud IP)
ControlPlaneDefaultRoute: 192.168.24.254 ControlPlaneDefaultRoute: 192.168.24.254
EC2MetadataIp: 192.168.24.1 # Generally the IP of the Undercloud EC2MetadataIp: 192.168.24.1 # Generally the IP of the Undercloud
# Customize the IP subnets to match the local environment {% for network in networks if network.enabled|default(true) %}
{%- for network in networks if network.enabled|default(true) %} # Customize the IP subnet to match the local environment
{%- if network.ipv6|default(false) %} {%- if network.ipv6|default(false) %}
{{network.name}}NetCidr: '{{network.ipv6_subnet}}' {{network.name}}NetCidr: '{{network.ipv6_subnet}}'
{%- else %} {%- else %}
{{network.name}}NetCidr: '{{network.ip_subnet}}' {{network.name}}NetCidr: '{{network.ip_subnet}}'
{%- endif %} {%- endif %}
{%- endfor %} # Customize the IP range to use for static IPs and VIPs
# Customize the VLAN IDs to match the local environment {%- if network.name == 'External' %}
{%- for network in networks if network.enabled|default(true) %}
{%- if network.vlan is defined %}
{{network.name}}NetworkVlanID: {{network.vlan}}
{%- endif %}
{%- endfor %}
{%- for network in networks if network.enabled|default(true) %}
{%- if network.name == 'External' %}
# Leave room if the external network is also used for floating IPs # Leave room if the external network is also used for floating IPs
{%- endif %} {%- endif %}
{%- if network.ipv6|default(false) %} {%- if network.ipv6|default(false) %}
{{network.name}}AllocationPools: {{network.ipv6_allocation_pools}} {{network.name}}AllocationPools: {{network.ipv6_allocation_pools}}
{%- else %} {%- else %}
{{network.name}}AllocationPools: {{network.allocation_pools}} {{network.name}}AllocationPools: {{network.allocation_pools}}
{%- endif %} {%- endif %}
{%- endfor %} {%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %}
# Gateway routers for routable networks # Gateway router for routable networks
{%- for network in networks if network.enabled|default(true) %}
{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %}
{{network.name}}InterfaceDefaultRoute: '{{network.gateway_ipv6}}' {{network.name}}InterfaceDefaultRoute: '{{network.gateway_ipv6}}'
{%- elif network.gateway_ip|default(false) %} {%- elif network.gateway_ip|default(false) %}
# Gateway router for routable networks
{{network.name}}InterfaceDefaultRoute: '{{network.gateway_ip}}' {{network.name}}InterfaceDefaultRoute: '{{network.gateway_ip}}'
{%- endif %} {%- endif %}
{%- endfor %} {%- if network.vlan is defined %}
# Customize the VLAN ID to match the local environment
{{network.name}}NetworkVlanID: {{network.vlan}}
{%- endif %}
{% endfor %}
{#- FIXME: These global parameters should be defined in a YAML file, e.g. network_data.yaml. #} {#- FIXME: These global parameters should be defined in a YAML file, e.g. network_data.yaml. #}
# Define the DNS servers (maximum 2) for the overcloud nodes # Define the DNS servers (maximum 2) for the overcloud nodes
DnsServers: ["8.8.8.8","8.8.4.4"] DnsServers: ["8.8.8.8","8.8.4.4"]