Simplify host entries generation
This removes a resource and the the unnecessary yaql function. Also replaces json data types with lists to reduce memory footprint. Change-Id: I04a6114ca3d2703ca2891d6807d49b78ffee0f97 Related-Bug: #1886203
This commit is contained in:
parent
2acb0d376b
commit
d573f4e878
|
@ -402,9 +402,8 @@ resources:
|
|||
VipHosts:
|
||||
type: OS::Heat::Value
|
||||
properties:
|
||||
type: json
|
||||
type: comma_delimited_list
|
||||
value:
|
||||
entries:
|
||||
- str_replace:
|
||||
template: IP HOST
|
||||
params:
|
||||
|
@ -807,31 +806,22 @@ resources:
|
|||
for_each:
|
||||
hostname: {get_param: DeploymentServerBlacklist}
|
||||
|
||||
# Single value comma delimited lists may be stored in strings
|
||||
# that fails lists concat. Make them always lists (nested are OK)
|
||||
HostsValue:
|
||||
type: OS::Heat::Value
|
||||
properties:
|
||||
type: json
|
||||
value:
|
||||
entries:
|
||||
- - {get_param: UndercloudHostsEntries}
|
||||
- - if:
|
||||
- add_vips_to_etc_hosts
|
||||
- {get_attr: [VipHosts, value, entries]}
|
||||
- []
|
||||
{%- for role in roles %}
|
||||
- {get_attr: [{{role.name}}, hosts_entry, entries]}
|
||||
{%- endfor %}
|
||||
- - {get_param: ExtraHostFileEntries}
|
||||
|
||||
HostsEntryValue:
|
||||
type: OS::Heat::Value
|
||||
properties:
|
||||
type: comma_delimited_list
|
||||
value:
|
||||
yaql:
|
||||
expression: coalesce($.data, []).where($ != null).where($ != []).flatten().distinct()
|
||||
data: {get_attr: [HostsValue, value, entries]}
|
||||
list_concat_unique:
|
||||
list_concat:
|
||||
- - {get_param: UndercloudHostsEntries}
|
||||
- - if:
|
||||
- add_vips_to_etc_hosts
|
||||
- {get_attr: [VipHosts, value]}
|
||||
- []
|
||||
{%- for role in roles %}
|
||||
- {get_attr: [{{role.name}}, hosts_entry]}
|
||||
{%- endfor %}
|
||||
- - {get_param: ExtraHostFileEntries}
|
||||
|
||||
CloudNames:
|
||||
type: OS::Heat::Value
|
||||
|
@ -1147,7 +1137,7 @@ resources:
|
|||
VipHostsEntries:
|
||||
if:
|
||||
- add_vips_to_etc_hosts
|
||||
- {get_attr: [VipHosts, value, entries]}
|
||||
- {get_attr: [VipHosts, value]}
|
||||
- []
|
||||
KeystoneResourcesConfigs:
|
||||
map_merge:
|
||||
|
@ -1184,7 +1174,7 @@ outputs:
|
|||
value:
|
||||
list_concat_unique:
|
||||
- {get_attr: [HostsEntryValue, value]}
|
||||
- {get_attr: [VipHosts, value, entries]}
|
||||
- {get_attr: [VipHosts, value]}
|
||||
EnabledServices:
|
||||
description: The services enabled on each role
|
||||
value:
|
||||
|
|
|
@ -633,7 +633,6 @@ outputs:
|
|||
HOSTNAME: {get_attr:[{{server_resource_name}}, name]}
|
||||
hosts_entry:
|
||||
value:
|
||||
entries:
|
||||
- str_replace:
|
||||
template: PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
|
||||
params:
|
||||
|
|
Loading…
Reference in New Issue