Merge "Use lists for storing host entries in Heat"
This commit is contained in:
commit
c07dd5dd88
|
@ -149,9 +149,9 @@ parameters:
|
||||||
Currently supports tarballs and RPM packages.
|
Currently supports tarballs and RPM packages.
|
||||||
type: comma_delimited_list
|
type: comma_delimited_list
|
||||||
HostsEntry:
|
HostsEntry:
|
||||||
default: ''
|
default: []
|
||||||
type: string
|
type: comma_delimited_list
|
||||||
description: A string of entries to be added to /etc/hosts on each node.
|
description: A list of entries to be added to /etc/hosts on each node.
|
||||||
AnsibleHostVarsMap:
|
AnsibleHostVarsMap:
|
||||||
type: json
|
type: json
|
||||||
default: {}
|
default: {}
|
||||||
|
|
|
@ -399,11 +399,10 @@ resources:
|
||||||
VipHosts:
|
VipHosts:
|
||||||
type: OS::Heat::Value
|
type: OS::Heat::Value
|
||||||
properties:
|
properties:
|
||||||
type: string
|
type: json
|
||||||
value:
|
value:
|
||||||
list_join:
|
entries:
|
||||||
- "\n"
|
- str_replace:
|
||||||
- - str_replace:
|
|
||||||
template: IP HOST
|
template: IP HOST
|
||||||
params:
|
params:
|
||||||
IP: {get_attr: [VipMap, net_ip_map, ctlplane]}
|
IP: {get_attr: [VipMap, net_ip_map, ctlplane]}
|
||||||
|
@ -791,34 +790,31 @@ resources:
|
||||||
for_each:
|
for_each:
|
||||||
hostname: {get_param: DeploymentServerBlacklist}
|
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:
|
HostsValue:
|
||||||
type: OS::Heat::Value
|
type: OS::Heat::Value
|
||||||
properties:
|
properties:
|
||||||
|
type: json
|
||||||
value:
|
value:
|
||||||
list_join:
|
entries:
|
||||||
- "\n"
|
- - {get_param: UndercloudHostsEntries}
|
||||||
- {get_param: UndercloudHostsEntries}
|
- - if:
|
||||||
- - if:
|
- add_vips_to_etc_hosts
|
||||||
- add_vips_to_etc_hosts
|
- {get_attr: [VipHosts, value, entries]}
|
||||||
- {get_attr: [VipHosts, value]}
|
- []
|
||||||
- ''
|
|
||||||
-
|
|
||||||
{%- for role in roles %}
|
{%- for role in roles %}
|
||||||
- list_join:
|
- {get_attr: [{{role.name}}, hosts_entry, entries]}
|
||||||
- ""
|
|
||||||
- {get_attr: [{{role.name}}, hosts_entry]}
|
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
- {get_param: ExtraHostFileEntries}
|
- - {get_param: ExtraHostFileEntries}
|
||||||
|
|
||||||
HostsEntryValue:
|
HostsEntryValue:
|
||||||
type: OS::Heat::Value
|
type: OS::Heat::Value
|
||||||
properties:
|
properties:
|
||||||
value:
|
value:
|
||||||
list_join:
|
yaql:
|
||||||
- ' '
|
expression: coalesce($.data, []).where($ != null).where($ != []).flatten().distinct()
|
||||||
- str_split:
|
data: {get_attr: [HostsValue, value, entries]}
|
||||||
- '\n'
|
|
||||||
- {get_attr: [HostsValue, value]}
|
|
||||||
|
|
||||||
CloudNames:
|
CloudNames:
|
||||||
type: OS::Heat::Value
|
type: OS::Heat::Value
|
||||||
|
@ -1130,8 +1126,8 @@ resources:
|
||||||
VipHostsEntries:
|
VipHostsEntries:
|
||||||
if:
|
if:
|
||||||
- add_vips_to_etc_hosts
|
- add_vips_to_etc_hosts
|
||||||
- {get_attr: [VipHosts, value]}
|
- {get_attr: [VipHosts, value, entries]}
|
||||||
- ''
|
- []
|
||||||
KeystoneResourcesConfigs:
|
KeystoneResourcesConfigs:
|
||||||
map_merge:
|
map_merge:
|
||||||
{% for role in roles %}
|
{% for role in roles %}
|
||||||
|
@ -1165,10 +1161,9 @@ outputs:
|
||||||
hostname-based access to the deployed nodes (useful for testing without
|
hostname-based access to the deployed nodes (useful for testing without
|
||||||
setting up a DNS).
|
setting up a DNS).
|
||||||
value:
|
value:
|
||||||
list_join:
|
list_concat_unique:
|
||||||
- "\n"
|
- {get_attr: [HostsEntryValue, value]}
|
||||||
- - {get_attr: [HostsEntryValue, value]}
|
- {get_attr: [VipHosts, value, entries]}
|
||||||
- - {get_attr: [VipHosts, value]}
|
|
||||||
EnabledServices:
|
EnabledServices:
|
||||||
description: The services enabled on each role
|
description: The services enabled on each role
|
||||||
value:
|
value:
|
||||||
|
|
|
@ -632,27 +632,33 @@ outputs:
|
||||||
HOSTNAME: {get_attr:[{{server_resource_name}}, name]}
|
HOSTNAME: {get_attr:[{{server_resource_name}}, name]}
|
||||||
hosts_entry:
|
hosts_entry:
|
||||||
value:
|
value:
|
||||||
str_replace:
|
entries:
|
||||||
template: |
|
- str_replace:
|
||||||
PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
|
template: PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
|
||||||
|
params:
|
||||||
|
PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]}
|
||||||
|
DOMAIN: {get_param: CloudDomain}
|
||||||
|
PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
|
||||||
{%- for network in networks %}
|
{%- for network in networks %}
|
||||||
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
|
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
|
||||||
{{network.name}}IP {{network.name}}HOST.DOMAIN {{network.name}}HOST
|
- str_replace:
|
||||||
|
template: {{network.name}}IP {{network.name}}HOST.DOMAIN {{network.name}}HOST
|
||||||
|
params:
|
||||||
|
DOMAIN: {get_param: CloudDomain}
|
||||||
|
{%- 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 %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
|
- str_replace:
|
||||||
params:
|
template: CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
|
||||||
PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]}
|
params:
|
||||||
DOMAIN: {get_param: CloudDomain}
|
DOMAIN: {get_param: CloudDomain}
|
||||||
PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
|
CTLPLANEIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
|
||||||
{%- for network in networks %}
|
CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
|
||||||
{%- 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]}
|
|
||||||
nova_server_resource:
|
nova_server_resource:
|
||||||
description: Heat resource handle for {{role.name}} server
|
description: Heat resource handle for {{role.name}} server
|
||||||
value:
|
value:
|
||||||
|
|
Loading…
Reference in New Issue