Merge "Check for available networks for a role"

This commit is contained in:
Zuul 2018-12-05 19:01:14 +00:00 committed by Gerrit Code Review
commit 769f18f0f5
5 changed files with 52 additions and 4 deletions

View File

@ -523,7 +523,7 @@ resources:
depends_on: {{role.name}}AllNodesDeployment
properties:
name: {{role.name}}AllNodesValidationDeployment
config: {get_resource: AllNodesValidationConfig}
config: {get_resource: {{role.name}}AllNodesValidationConfig}
servers: {get_attr: [{{role.name}}Servers, value]}
{{role.name}}IpListMap:
@ -531,7 +531,7 @@ resources:
properties:
ControlPlaneIpList: {get_attr: [{{role.name}}, ip_address]}
{%- for network in networks %}
{%- if network.enabled|default(true) %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}IpList: {get_attr: [{{role.name}}, {{network.name_lower}}_ip_address]}
{%- else %}
{{network.name}}IpList: {get_attr: [{{role.name}}, ip_address]}
@ -851,18 +851,22 @@ resources:
# ServiceNetMap's attribute values are available.
depends_on: ServiceNetMap
{%- for role in roles %}
# All Nodes Validations
AllNodesValidationConfig:
{{role.name}}AllNodesValidationConfig:
type: OS::TripleO::AllNodes::Validation
properties:
PingTestIps:
list_join:
- ' '
-
{%- for network in networks if network.enabled|default(true) %}
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
- yaql:
expression: coalesce($.data, []).first(null)
data: {get_attr: [{{primary_role_name}}, {{network.name_lower}}_ip_address]}
{%- endif %}
{%- endfor %}
{%- endfor %}
# Optional ExtraConfig for all nodes - all roles are passed in here, but

View File

@ -270,6 +270,7 @@ parameters:
dns_nameservers attribute will be used.
type: comma_delimited_list
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}InterfaceRoutes:
default: []
description: >
@ -278,6 +279,7 @@ parameters:
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
{%- endif %}
{%- endfor %}
ServerDeletionPolicy:
@ -348,6 +350,7 @@ conditions:
{%- endif %}
- false # NOTE(hjensas): Make sure 'or' get's 2 conditions or more
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{role.name}}_{{network.name}}_fixed_ip_set:
not:
equals:
@ -358,6 +361,7 @@ conditions:
equals:
- {get_param: {{network.name}}InterfaceRoutes}
- []
{%- endif %}
{%- endfor %}
ctlplane_subnet_cidr_set:
not:
@ -472,6 +476,7 @@ resources:
type: OS::TripleO::{{role.name}}::NodeUserData
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}Port:
type: OS::TripleO::{{role.name}}::Ports::{{network.name}}Port
properties:
@ -503,6 +508,7 @@ resources:
{%- endif %}
- {get_param: {{role.name}}IPs}
NodeIndex: {get_param: NodeIndex}
{%- endif %}
{%- endfor %}
NetworkConfig:
@ -543,12 +549,14 @@ resources:
- {get_attr: [{{server_resource_name}}, addresses, ctlplane, 0, subnets, 0, dns_nameservers]}
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}IpSubnet: {get_attr: [{{network.name}}Port, ip_subnet]}
{{network.name}}InterfaceRoutes:
if:
- {{network.name_lower}}_interface_routes_set
- {get_param: {{network.name}}InterfaceRoutes}
- {get_attr: [{{network.name}}Port, host_routes]}
{%- endif %}
{%- endfor %}
NetIpMap:
@ -565,9 +573,11 @@ resources:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}Ip: {get_attr: [{{network.name}}Port, ip_address]}
{{network.name}}IpSubnet: {get_attr: [{{network.name}}Port, ip_subnet]}
{{network.name}}IpUri: {get_attr: [{{network.name}}Port, ip_address_uri]}
{%- endif %}
{%- endfor %}
NetHostMap:
@ -576,6 +586,7 @@ resources:
type: json
value:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name_lower}}:
fqdn:
list_join:
@ -588,6 +599,7 @@ resources:
- '.'
- - {get_attr: [{{server_resource_name}}, name]}
- {{network.name.lower()}}
{%- endif %}
{%- endfor %}
ctlplane:
fqdn:
@ -721,7 +733,9 @@ resources:
{{role.name.lower()}}:
tripleo::clouddomain: {get_param: CloudDomain}
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
fqdn_{{network.name_lower}}: {get_attr: [NetHostMap, value, {{network.name_lower}}, fqdn]}
{%- endif %}
{%- endfor %}
fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
@ -779,8 +793,10 @@ resources:
str_replace:
template: "[PRIMARYIP]*,[PRIMARYHOST.DOMAIN]*,[PRIMARYHOST]*,\
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
[{{network.name}}IP]*,[{{network.name}}HOST.DOMAIN]*,\
[{{network.name}}HOST]*,\
{%- endif %}
{%- endfor %}
[CTLPLANEIP]*,[CTLPLANEHOST.DOMAIN]*,[CTLPLANEHOST]*"
params:
@ -788,8 +804,10 @@ resources:
DOMAIN: {get_param: CloudDomain}
PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}IP: {get_attr: [{{network.name}}Port, ip_address]}
{{network.name}}HOST: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower())}}, short]}
{%- endif %}
{%- endfor %}
CTLPLANEIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
@ -819,7 +837,9 @@ outputs:
description: Mapping of network names to hostnames
value:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name_lower|default(network.name.lower())}}: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower()) }}, fqdn]}
{%- endif %}
{%- endfor %}
ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
@ -829,7 +849,9 @@ outputs:
template: |
PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}IP {{network.name}}HOST.DOMAIN {{network.name}}HOST
{%- endif %}
{%- endfor %}
CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
params:
@ -837,8 +859,10 @@ outputs:
DOMAIN: {get_param: CloudDomain}
PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}IP: {get_attr: [{{network.name}}Port, ip_address]}
{{network.name}}HOST: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower())}}, short]}
{%- endif %}
{%- endfor %}
CTLPLANEIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
@ -906,9 +930,11 @@ outputs:
description: The os-collect-config configuration associated with this server resource
value: {get_attr: [{{server_resource_name}}, os_collect_config]}
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name_lower|default(network.name.lower())}}_ip_address:
description: IP address of the server in the {{network.name}} network
value: {get_attr: [{{network.name}}Port, ip_address]}
{%- endif %}
{%- endfor %}
role_group_vars:
value:

View File

@ -11,6 +11,12 @@
tags:
- primary
- controller
networks:
- External
- InternalApi
- Storage
- StorageMgmt
- Tenant
disable_constraints: True
ServicesDefault:
- OS::TripleO::Services::Aide

View File

@ -10,6 +10,12 @@
tags:
- primary
- controller
networks:
- External
- InternalApi
- Storage
- StorageMgmt
- Tenant
ServicesDefault:
- OS::TripleO::Services::Aide
- OS::TripleO::Services::AodhApi

View File

@ -13,6 +13,12 @@
tags:
- primary
- controller
networks:
- External
- InternalApi
- Storage
- StorageMgmt
- Tenant
ServicesDefault:
- OS::TripleO::Services::Aide
- OS::TripleO::Services::AodhApi