Use ansible for hosts entries

This patch updates the templates to use the new ansible role,
tripleo-hosts-entries, for managing the entries in /etc/hosts instead of
the values from the Heat stack.

Change-Id: I606e0f27f9f9ae9d85bc0fc653f8985eb734d004
Depends-On: Ia02ca1263590e2b579f2534e99119d7b1cd4b39a
This commit is contained in:
James Slagle 2019-10-22 14:31:42 -04:00
parent 739e379e5b
commit 597cdb6796
4 changed files with 41 additions and 4 deletions

View File

@ -203,6 +203,21 @@ parameters:
default: {}
type: json
description: Map of extra data (hieradata) to set on each node.
UndercloudHostsEntries:
default: []
description: >
List of undercloud hosts entries to be appended to /etc/hosts. The
value is populated with the HEAT_HOSTS entries on the undercloud by
tripleoclient when running deploy.
type: comma_delimited_list
ExtraHostsEntries:
default: []
description: List of extra hosts entries to be appended to /etc/hosts
type: comma_delimited_list
VipHostsEntries:
default: []
description: List of VIP (virtual IP) hosts entries to be appended to /etc/hosts
type: comma_delimited_list
conditions:
{% for role in enabled_roles %}
@ -371,6 +386,9 @@ outputs:
enable_internal_tls: {get_param: EnableInternalTLS}
cloud_domain: {get_param: CloudDomain}
all_nodes_extra_map_data: {get_param: AllNodesExtraMapData}
undercloud_hosts_entries: {get_param: UndercloudHostsEntries}
extra_hosts_entries: {get_param: ExtraHostsEntries}
vip_hosts_entries: {get_param: VipHostsEntries}
common_deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
common_deploy_steps_tasks_step_1: {get_file: deploy-steps-tasks-step-1.yaml}
container_startup_configs_tasks: {get_file: container_startup_configs_tasks.yaml}
@ -658,10 +676,15 @@ outputs:
environment:
artifact_urls: {{ '"{{' }} deploy_artifact_urls {{ '}}"' }}
- name: HostsConfig
script: hosts-config.sh
environment:
HOSTS_ENTRY: {{ '"{{' }} hosts_entry {{ '}}"' }}
- name: Configure Hosts Entries
include_role:
name: tripleo-hosts-entries
vars:
tripleo_hosts_entries_undercloud_hosts_entries: {{ '"{{ ' }} undercloud_hosts_entries {{ ' }}"' }}
tripleo_hosts_entries_extra_hosts_entries: {{ '"{{ ' }} extra_hosts_entries {{ ' }}"' }}
tripleo_hosts_entries_vip_hosts_entries: {{ '"{{ ' }} vip_hosts_entries {{ ' }}"' }}
tags:
- tripleo_hosts_entries
tags:
- overcloud

View File

@ -1121,6 +1121,13 @@ resources:
- redis: {get_attr: [RedisVirtualIP, ip_address]}
- ovn_dbs: {get_attr: [OVNDBsVirtualIP, ip_address]}
CloudNames: {get_attr: [CloudNames, value]}
UndercloudHostsEntries: {get_param: UndercloudHostsEntries}
ExtraHostsEntries: {get_param: ExtraHostFileEntries}
VipHostsEntries:
if:
- add_vips_to_etc_hosts
- {get_attr: [VipHosts, value]}
- ''
outputs:
ManagedEndpoints:

View File

@ -589,6 +589,7 @@ resources:
{%- endfor %}
fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
hostname_resolve_network: {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}
outputs:
ansible_host_vars_map:

View File

@ -0,0 +1,6 @@
---
features:
- |
The ansible tripleo-hosts-entries is now used for adding individual entries
to /etc/hosts for each overcloud node. This role is used instead of the
output data from the Heat stack.