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)
ControlPlaneDefaultRoute: 192.168.24.254
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
{%- for network in networks if network.enabled|default(true) %}
{%- if network.name != 'Tenant' %}
{{network.name}}NetCidr: '{{network.ipv6_subnet}}'
{%- else %}
# Tenant tunneling network is IPv4 until IPv6 is fully supported
{{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' %}
# Customize the IP range to use for static IPs and VIPs
{%- if network.name == 'External' %}
# Leave room if the external network is also used for floating IPs
{%- endif %}
{%- if network.name != 'Tenant' %}
{%- endif %}
{{network.name}}AllocationPools: {{network.ipv6_allocation_pools}}
{%- else %}
# Tenant tunneling network should be IPv4
{{network.name}}AllocationPools: {{network.ip_allocation_pools}}
{%- endif %}
{%- endfor %}
# Gateway routers for routable networks
{%- for network in networks if network.enabled|default(true) and network.gateway_ipv6|default(false) %}
{%- else %}
# Tenant tunneling network is IPv4 until IPv6 is fully supported
# Customize the IP subnets to match the local environment
{{network.name}}NetCidr: '{{network.ip_subnet}}'
# Customize the IP range to use for static IPs and VIPs
{{network.name}}AllocationPools: {{network.allocation_pools}}
{%- endif %}
{%- if network.enabled|default(true) and network.gateway_ipv6|default(false) %}
# Gateway router for routable networks
{{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. #}
# Define the DNS servers (maximum 2) for the overcloud nodes
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)
ControlPlaneDefaultRoute: 192.168.24.254
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) %}
{%- if network.ipv6|default(false) %}
{% for network in networks if network.enabled|default(true) %}
# Customize the IP subnet to match the local environment
{%- if network.ipv6|default(false) %}
{{network.name}}NetCidr: '{{network.ipv6_subnet}}'
{%- else %}
{%- else %}
{{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 %}
{%- for network in networks if network.enabled|default(true) %}
{%- if network.name == 'External' %}
{%- endif %}
# Customize the IP range to use for static IPs and VIPs
{%- if network.name == 'External' %}
# Leave room if the external network is also used for floating IPs
{%- endif %}
{%- if network.ipv6|default(false) %}
{%- endif %}
{%- if network.ipv6|default(false) %}
{{network.name}}AllocationPools: {{network.ipv6_allocation_pools}}
{%- else %}
{%- else %}
{{network.name}}AllocationPools: {{network.allocation_pools}}
{%- endif %}
{%- endfor %}
# Gateway routers for routable networks
{%- for network in networks if network.enabled|default(true) %}
{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %}
{%- endif %}
{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %}
# Gateway router for routable networks
{{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}}'
{%- endif %}
{%- 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. #}
# Define the DNS servers (maximum 2) for the overcloud nodes
DnsServers: ["8.8.8.8","8.8.4.4"]