Merge "Move GroupVars to overcloud.j2.yaml"

This commit is contained in:
Zuul 2019-08-23 15:48:05 +00:00 committed by Gerrit Code Review
commit 81d6c8b9d2
2 changed files with 87 additions and 91 deletions

View File

@ -89,6 +89,10 @@ parameters:
default: 'ctlplane' default: 'ctlplane'
type: string type: string
description: Neutron ID or name for ctlplane network. description: Neutron ID or name for ctlplane network.
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
NeutronPublicInterface: NeutronPublicInterface:
default: nic1 default: nic1
description: Which interface to add to the NeutronPhysicalBridge. description: Which interface to add to the NeutronPhysicalBridge.
@ -131,7 +135,11 @@ parameters:
Extra properties or metadata passed to Nova for the created nodes in Extra properties or metadata passed to Nova for the created nodes in
the overcloud. It's accessible via the Nova metadata API. the overcloud. It's accessible via the Nova metadata API.
type: json type: json
NetworkDeploymentActions:
type: comma_delimited_list
description: >
Heat action when to apply network configuration changes
default: ['CREATE']
# Compute-specific params # Compute-specific params
# FIXME(shardy) handle these deprecated names as they don't match compute.yaml # FIXME(shardy) handle these deprecated names as they don't match compute.yaml
HypervisorNeutronPhysicalBridge: HypervisorNeutronPhysicalBridge:
@ -190,7 +198,19 @@ parameters:
resource_registry) which represent nested stacks resource_registry) which represent nested stacks
for each service that should get installed on the {{role.name}} role. for each service that should get installed on the {{role.name}} role.
type: comma_delimited_list type: comma_delimited_list
{{role.name}}NetworkDeploymentActions:
type: comma_delimited_list
description: >
Heat action when to apply network configuration changes
default: []
{{role.name}}AnyErrorsFatal:
default: yes
type: string
{#- We generally won't want any failures on HA Controller roles, 15% will cause any 1 node to fail the deploy, #}
{#- for a 3 or 5 node Role, making it a fairly safe default. #}
{{role.name}}MaxFailPercentage:
default: 15
type: number
{{role.name}}Count: {{role.name}}Count:
description: Number of {{role.name}} nodes to deploy description: Number of {{role.name}} nodes to deploy
type: number type: number
@ -324,6 +344,13 @@ conditions:
- equals: - equals:
- get_param: [EndpointMapOverride, MysqlCellInternal] - get_param: [EndpointMapOverride, MysqlCellInternal]
- '' - ''
{%- for role in roles %}
{{role.name}}_network_deployment_actions_exists:
not:
equals:
- {get_param: {{role.name}}NetworkDeploymentActions}
- []
{%- endfor %}
set_default_nova_vnc_proxy_cell_public: set_default_nova_vnc_proxy_cell_public:
or: or:
- equals: - equals:
@ -515,6 +542,15 @@ resources:
type: json type: json
value: {get_attr: [{{role.name}}ServiceChain, role_data]} value: {get_attr: [{{role.name}}ServiceChain, role_data]}
{{role.name}}NetworkDeploymentActionsValue:
type: OS::Heat::Value
properties:
value:
- if:
- {{role.name}}_network_deployment_actions_exists
- {get_param: {{role.name}}NetworkDeploymentActions}
- {get_param: NetworkDeploymentActions}
{{role.name}}ConfigData: {{role.name}}ConfigData:
type: OS::Heat::Value type: OS::Heat::Value
properties: properties:
@ -816,6 +852,48 @@ resources:
properties: properties:
CtlplaneNetworkCidrs: {get_attr: [ControlVirtualIP, network, tags]} CtlplaneNetworkCidrs: {get_attr: [ControlVirtualIP, network, tags]}
{%- for role in roles %}
{{role.name}}GroupVars:
type: OS::Heat::Value
properties:
value:
bootstrap_nodeid:
yaql:
expression: coalesce($.data, []).where(not isEmpty($)).first()
data: {get_attr: [{{role.name}}, hostname]}
ctlplane_subnet_cidr:
yaql:
expression: coalesce($.data, []).where(not isEmpty($)).first().split('/')[-1]
data:
if:
- ctlplane_subnet_cidr_set
- [{get_param: ControlPlaneSubnetCidr}]
- {get_attr: [ControlVirtualIP, network, tags]}
network_cidrs:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}_cidr:
yaql:
expression: coalesce($.data, []).where(not isEmpty($)).first().split('/')[-1]
data: {get_attr: [Networks, net_cidr_map, {{network.name_lower}}]}
{%- endif %}
{%- endfor %}
role_networks:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
- {{network.name}}
{% endif %}
{% endfor %}
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name_lower}}_cidr:
yaql:
expression: coalesce($.data, []).where(not isEmpty($)).first().split('/')[-1]
data: {get_attr: [Networks, net_cidr_map, {{network.name_lower}}]}
{% endif %}
{% endfor %}
{% endfor %}
ControlVirtualIP: ControlVirtualIP:
depends_on: ServiceNetMap depends_on: ServiceNetMap
type: OS::TripleO::Network::Ports::ControlPlaneVipPort type: OS::TripleO::Network::Ports::ControlPlaneVipPort
@ -1081,9 +1159,13 @@ outputs:
{%- for role in roles %} {%- for role in roles %}
{{role.name}}: {{role.name}}:
map_merge: map_merge:
list_concat: - {get_attr: [{{role.name}}GroupVars, value]}
- {get_attr: [{{role.name}}, role_group_vars]} - {get_attr: [{{role.name}}ConfigData, value]}
- [{get_attr: [{{role.name}}ConfigData, value]}] - any_errors_fatal: {get_param: {{role.name}}AnyErrorsFatal}
max_fail_percentage: {get_param: {{role.name}}MaxFailPercentage}
neutron_physical_bridge_name: {get_param: NeutronPhysicalBridge}
neutron_public_interface_name: {get_param: NeutronPublicInterface}
network_deployment_actions: {get_attr: [{{role.name}}NetworkDeploymentActionsValue, value]}
{%- endfor %} {%- endfor %}
RoleNetHostnameMap: RoleNetHostnameMap:
description: Mapping of each network to a list of hostnames for each role description: Mapping of each network to a list of hostnames for each role

View File

@ -35,14 +35,6 @@ parameters:
description: Name of an existing Nova key pair to enable SSH access to the instances description: Name of an existing Nova key pair to enable SSH access to the instances
type: string type: string
default: default default: default
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
NeutronPublicInterface:
default: nic1
description: Which interface to add to the NeutronPhysicalBridge.
type: string
ServiceNetMap: ServiceNetMap:
default: {} default: {}
description: Mapping of service_name -> network name. Typically set description: Mapping of service_name -> network name. Typically set
@ -75,16 +67,6 @@ parameters:
description: DEPRECATED - use {{role.name}}IPs instead description: DEPRECATED - use {{role.name}}IPs instead
type: json type: json
{%- endif %} {%- endif %}
{{role.name}}NetworkDeploymentActions:
type: comma_delimited_list
description: >
Heat action when to apply network configuration changes
default: []
NetworkDeploymentActions:
type: comma_delimited_list
description: >
Heat action when to apply network configuration changes
default: ['CREATE']
SoftwareConfigTransport: SoftwareConfigTransport:
default: POLL_SERVER_CFN default: POLL_SERVER_CFN
description: | description: |
@ -178,14 +160,6 @@ parameters:
description: | description: |
Name of the subnet on ctlplane network for this role. Name of the subnet on ctlplane network for this role.
type: string type: string
{{role.name}}AnyErrorsFatal:
default: yes
type: string
{#- We generally won't want any failures on HA Controller roles, 15% will cause any 1 node to fail the deploy, #}
{#- for a 3 or 5 node Role, making it a fairly safe default. #}
{{role.name}}MaxFailPercentage:
default: 15
type: number
ControlPlaneSubnetCidr: ControlPlaneSubnetCidr:
default: '' default: ''
description: > description: >
@ -291,11 +265,6 @@ conditions:
- {get_param: {{role.deprecated_param_flavor}}} - {get_param: {{role.deprecated_param_flavor}}}
- {{default_flavor_name}} - {{default_flavor_name}}
{%- endif %} {%- endif %}
role_network_deployment_actions_exists:
not:
equals:
- {get_param: {{role.name}}NetworkDeploymentActions}
- []
ctlplane_fixed_ip_set: ctlplane_fixed_ip_set:
or: or:
- not: - not:
@ -570,15 +539,6 @@ resources:
ServiceNames: {get_param: ServiceNames} ServiceNames: {get_param: ServiceNames}
deployment_actions: {get_attr: [DeploymentActions, value]} deployment_actions: {get_attr: [DeploymentActions, value]}
NetworkDeploymentActionsValue:
type: OS::Heat::Value
properties:
value:
- if:
- role_network_deployment_actions_exists
- {get_param: {{role.name}}NetworkDeploymentActions}
- {get_param: NetworkDeploymentActions}
# Resource for site-specific injection of root certificate # Resource for site-specific injection of root certificate
NodeTLSCAData: NodeTLSCAData:
depends_on: PreNetworkConfig depends_on: PreNetworkConfig
@ -630,37 +590,6 @@ resources:
fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
{{server_resource_name}}GroupVars:
type: OS::Heat::Value
properties:
value:
bootstrap_nodeid: {get_attr: [{{server_resource_name}}, name]}
ctlplane_subnet_cidr:
if:
- ctlplane_subnet_cidr_set
- {get_param: ControlPlaneSubnetCidr}
- yaql:
expression: str("{0}".format($.data).split("/")[-1])
data: {get_attr: [{{server_resource_name}}, addresses, ctlplane, 0, subnets, 0, cidr]}
network_cidrs:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}_cidr: {get_attr: [{{network.name}}Port, cidr]}
{%- endif %}
{%- endfor %}
role_networks:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
- {{network.name}}
{% endif %}
{% endfor %}
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name_lower}}_cidr: {get_attr: [{{network.name}}Port, cidr]}
{%- endif %}
{%- endfor %}
outputs: outputs:
ansible_host_vars_map: ansible_host_vars_map:
description: | description: |
@ -763,18 +692,3 @@ outputs:
value: {get_attr: [{{network.name}}Port, ip_address]} value: {get_attr: [{{network.name}}Port, ip_address]}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
role_group_vars:
value:
map_merge:
- any_errors_fatal: {get_param: {{role.name}}AnyErrorsFatal}
max_fail_percentage: {get_param: {{role.name}}MaxFailPercentage}
neutron_physical_bridge_name: {get_param: NeutronPhysicalBridge}
neutron_public_interface_name: {get_param: NeutronPublicInterface}
network_deployment_actions: {get_attr: [NetworkDeploymentActionsValue, value]}
role_networks:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
- {{network.name}}
{%- endif %}
{%- endfor %}
- {get_attr: [{{server_resource_name}}GroupVars, value]}