Also pass blacklisted hostnames

Workflows may need access to the list of blacklisted hostnames so they
can filter on that value. This change adds that input to the workflow
execution environment.

Change-Id: I41de32b324a406633699d17933ae05417b28c57b
Partial-Bug: #1743046
This commit is contained in:
James Slagle 2018-01-12 17:17:14 -05:00 committed by Jiri Stransky
parent 79570ed2b9
commit d4a5876e57
3 changed files with 23 additions and 0 deletions

View File

@ -66,6 +66,10 @@ parameters:
description: List of IP addresses belong to blacklisted servers description: List of IP addresses belong to blacklisted servers
type: comma_delimited_list type: comma_delimited_list
default: [] default: []
blacklisted_hostnames:
description: List of hostnames belong to blacklisted servers
type: comma_delimited_list
default: []
conditions: conditions:
{% for step in range(1, deploy_steps_max) %} {% for step in range(1, deploy_steps_max) %}
@ -178,6 +182,7 @@ resources:
{{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]} {{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]}
{%- endfor %} {%- endfor %}
blacklisted_ip_addresses: {get_param: blacklisted_ip_addresses} blacklisted_ip_addresses: {get_param: blacklisted_ip_addresses}
blacklisted_hostnames: {get_param: blacklisted_hostnames}
evaluate_env: false evaluate_env: false
UPDATE: UPDATE:
workflow: { get_resource: WorkflowTasks_Step{{step}} } workflow: { get_resource: WorkflowTasks_Step{{step}} }
@ -189,6 +194,7 @@ resources:
{{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]} {{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]}
{%- endfor %} {%- endfor %}
blacklisted_ip_addresses: {get_param: blacklisted_ip_addresses} blacklisted_ip_addresses: {get_param: blacklisted_ip_addresses}
blacklisted_hostnames: {get_param: blacklisted_hostnames}
evaluate_env: false evaluate_env: false
always_update: true always_update: true
# END workflow_tasks handling # END workflow_tasks handling

View File

@ -859,6 +859,15 @@ resources:
- {get_attr: [{{role.name}}, blacklist_ip_address]} - {get_attr: [{{role.name}}, blacklist_ip_address]}
{% endfor %} {% endfor %}
BlacklistedHostnames:
type: OS::Heat::Value
properties:
value:
list_concat:
{% for role in roles %}
- {get_attr: [{{role.name}}, blacklist_hostname]}
{% endfor %}
# Post deployment steps for all roles # Post deployment steps for all roles
AllNodesDeploySteps: AllNodesDeploySteps:
type: OS::TripleO::PostDeploySteps type: OS::TripleO::PostDeploySteps
@ -894,6 +903,7 @@ resources:
- {get_attr: [{{role.name}}MergedConfigSettings, value]} - {get_attr: [{{role.name}}MergedConfigSettings, value]}
{% endfor %} {% endfor %}
blacklisted_ip_addresses: {get_attr: [BlacklistedIpAddresses, value]} blacklisted_ip_addresses: {get_attr: [BlacklistedIpAddresses, value]}
blacklisted_hostnames: {get_attr: [BlacklistedHostnames, value]}
ServerOsCollectConfigData: ServerOsCollectConfigData:
type: OS::Heat::Value type: OS::Heat::Value

View File

@ -646,6 +646,13 @@ outputs:
- server_blacklisted - server_blacklisted
- {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]} - {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
- "" - ""
blacklist_hostname:
description: Hostname of the server if the server is blacklisted, otherwise this output will be an empty string
value:
if:
- server_blacklisted
- {get_attr: [{{server_resource_name}}, name]}
- ""
hostname: hostname:
description: Hostname of the server description: Hostname of the server
value: {get_attr: [{{server_resource_name}}, name]} value: {get_attr: [{{server_resource_name}}, name]}