Use ansible for AllNodesValidationConfig

Replaces the Heat SoftwareDeployment resoure for
AllNodesValidationConfig with an Ansible stask instead.

Depends-On: I0b3188ef45dc379f83c36561616b422418845b66
Change-Id: I6e8f8f29cf9ef906b9be55f27aa536d8cc200190
implements: blueprint reduce-deployment-resources
This commit is contained in:
James Slagle 2019-06-06 10:38:23 -04:00 committed by Emilien Macchi
parent b3b48cdc69
commit ec68f1740c
3 changed files with 55 additions and 30 deletions

View File

@ -120,6 +120,26 @@ parameters:
type: json
default: {}
{%- endfor %}
ValidateControllersIcmp:
default: true
description: Validation to ensure that all controllers can be reached with ICMP
type: boolean
ValidateGatewaysIcmp:
default: true
description: Validation to ensure that all gateways can be reached with ICMP
type: boolean
ValidateFqdn:
default: false
description: Optional validation to ensure FQDN as set by Nova matches the name set in /etc/hosts.
type: boolean
ValidateNtp:
default: true
description: Validation to ensure at least one time source is accessible.
type: boolean
PingTestIpsMap:
default: ''
description: A map of role name to a space separated list of IP addresses used to ping test each available network interface.
type: json
conditions:
{% for role in enabled_roles %}
@ -262,8 +282,14 @@ outputs:
deploy_steps_max: {{deploy_steps_max}}
ssh_known_hosts: {get_param: ssh_known_hosts_hostnames}
service_net_map: {get_param: ServiceNetMapLower}
validate_controllers_icmp: {get_param: ValidateControllersIcmp}
validate_gateways_icmp: {get_param: ValidateGatewaysIcmp}
validate_fqdn: {get_param: ValidateFqdn}
validate_ntp: {get_param: ValidateNtp}
ping_test_ips: {get_param: PingTestIpsMap}
common_deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
docker_puppet_script: {get_file: ./container-puppet.py}
all_nodes_validation_script.sh : {get_file: ../validation-scripts/all-nodes.sh}
deploy_steps_playbook:
str_replace:
params:
@ -381,6 +407,17 @@ outputs:
vars:
force: false
with_items: "{{ '{{' }} lookup('vars', tripleo_role_name + '_pre_deployments')|default([]) {{ '}}' }}"
- name: AllNodesValidationConfig
script: all_nodes_validation_script.sh
environment:
validate_controllers_icmp: {{ '"{{' }} validate_controllers_icmp {{ '}}"' }}
validate_gateways_icmp: {{ '"{{' }} validate_gateways_icmp {{ '}}"' }}
validate_fqdn: {{ '"{{' }} validate_fqdn {{ '}}"' }}
validate_ntp: {{ '"{{' }} validate_ntp {{ '}}"' }}
ping_test_ips: {{ '"{{' }} ping_test_ips | to_json {{ '}}"' }}
tripleo_role_name: {{ '"{{' }} tripleo_role_name {{ '}}"' }}
tags:
- overcloud
- pre_deploy_steps

View File

@ -596,14 +596,6 @@ resources:
config: {get_attr: [{{role.name}}allNodesConfig, config_id]}
servers: {get_attr: [{{role.name}}Servers, value]}
{{role.name}}AllNodesValidationDeployment:
type: OS::Heat::StructuredDeployments
depends_on: {{role.name}}AllNodesDeployment
properties:
name: {{role.name}}AllNodesValidationDeployment
config: {get_resource: {{role.name}}AllNodesValidationConfig}
servers: {get_attr: [{{role.name}}Servers, value]}
{{role.name}}IpListMap:
type: OS::TripleO::Network::Ports::NetIpListMap
properties:
@ -966,33 +958,13 @@ resources:
# ServiceNetMap's attribute values are available.
depends_on: ServiceNetMap
# All Nodes Validations
{%- for role in roles %}
{{role.name}}AllNodesValidationConfig:
type: OS::TripleO::AllNodes::Validation
properties:
PingTestIps:
list_join:
- ' '
- - yaql:
expression: coalesce($.data, []).first(null)
data: {get_attr: [{{role.name}}, ip_address]}
{%- 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: [{{role.name}}, {{network.name_lower}}_ip_address]}
{%- endif %}
{%- endfor %}
{%- endfor %}
# Optional ExtraConfig for all nodes - all roles are passed in here, but
# the nested template may configure each role differently (or not at all)
AllNodesExtraConfig:
type: OS::TripleO::AllNodesExtraConfig
depends_on:
{%- for role in roles %}
- {{role.name}}AllNodesValidationDeployment
- {{role.name}}HostsDeployment
{%- endfor %}
properties:
servers:
@ -1045,6 +1017,22 @@ resources:
{{role.name}}AllNodesDeploymentHieradata: {get_attr: [{{role.name}}allNodesConfig, all_nodes_config_hieradata]}
{%- endfor %}
ServiceNetMapLower: {get_attr: [ServiceNetMap, service_net_map_lower]}
PingTestIpsMap:
{%- for role in roles %}
{{role.name}}:
list_join:
- ' '
- - yaql:
expression: coalesce($.data, []).first(null)
data: {get_attr: [{{role.name}}, ip_address]}
{%- 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: [{{role.name}}, {{network.name_lower}}_ip_address]}
{%- endif %}
{%- endfor %}
{%- endfor %}
ServerOsCollectConfigData:
type: OS::Heat::Value

View File

@ -129,7 +129,7 @@ if [[ $validate_gateways_icmp == "True" ]];then
ping_default_gateways
fi
if [[ $validate_controllers_icmp == "True" ]];then
ping_controller_ips "$ping_test_ips"
ping_controller_ips $(echo "$ping_test_ips" | jq -r ".$tripleo_role_name")
fi
if [[ $validate_fqdn == "True" ]];then
fqdn_check