Merge "Set HieradataVars as group vars instead"

This commit is contained in:
Zuul 2019-07-19 07:32:15 +00:00 committed by Gerrit Code Review
commit b8de91a534
3 changed files with 34 additions and 48 deletions

View File

@ -119,9 +119,6 @@ parameters:
{{role.name}}DeploymentHierarchy:
type: json
default: {}
{{role.name}}HieradataVars:
type: json
default: {}
{%- endfor %}
ValidateControllersIcmp:
default: true
@ -520,8 +517,6 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Server hieradata from vars
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
vars_files:
- {{role.name}}/hieradata_vars.yaml
tasks:
- name: Hieradata from vars
include_role:
@ -805,7 +800,6 @@ outputs:
{%- for role in roles %}
{{role.name}}/deployment-hieradata.j2.yaml: {get_param: {{role.name}}DeploymentHieradata}
{{role.name}}/deployment-hierarchy.yaml: {get_param: {{role.name}}DeploymentHierarchy}
{{role.name}}/hieradata_vars: {get_param: {{role.name}}HieradataVars}
{%- endfor %}
update_steps_tasks: |
{%- for role in roles %}

View File

@ -734,38 +734,6 @@ resources:
{%- endfor %}
cloud_name_ctlplane: {get_param: CloudNameCtlplane}
{%- for outer_role in roles %}
{{outer_role.name}}HieradataVars:
type: OS::Heat::Value
properties:
value:
bootstrap_nodeid:
yaql:
expression: coalesce($.data, []).first(null)
data: {get_attr: [{{outer_role.name}}, hostname]}
ctlplane_subnet_cidr:
if:
- ctlplane_subnet_cidr_set
- {get_param: ControlPlaneSubnetCidr}
- {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]}
network_cidrs:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in outer_role.networks|default([]) %}
{{network.name}}_cidr:
yaql:
expression: switch(isList($.data) and $.data.len() > 0 => $.data[0], true => "")
data: {get_attr: [{{outer_role.name}}, {{network.name}}_cidr]}
{%- endif %}
{%- endfor %}
role_networks:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in outer_role.networks|default([]) %}
- {{network.name}}
{% endif %}
{% endfor %}
{%- endfor %}
GlobalConfig:
type: OS::Heat::Value
properties:
@ -1012,9 +980,6 @@ resources:
{%- endfor %}
{%- endfor %}
HostsEntry: {get_attr: [HostsEntryValue, value]}
{%- for role in roles %}
{{role.name}}HieradataVars: {get_attr: [{{role.name}}HieradataVars, value]}
{%- endfor %}
EnabledServices:
list_concat:
{%- for role in roles %}

View File

@ -710,6 +710,31 @@ resources:
fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, 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 %}
outputs:
ansible_host_vars_map:
@ -818,17 +843,19 @@ outputs:
{%- endfor %}
role_group_vars:
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: [NetworkDeploymentActionsValue, value]}
role_networks:
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}}
- {{network.name}}
{%- endif %}
{%- endfor %}
- {get_attr: [{{server_resource_name}}GroupVars, value]}
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}_cidr: