Write hosts entries per environment

This change will write /etc/hosts entries per plan
rather than stomping the hosts entries every time
the role is used for different stacks / plans.

We achieve this by differentiating the blocks of IP
addresses to ensure they are not modified by unrelated
executions of the role.

Closes-Bug: #1924751
RHBZ: 1933528
Depends-On: I9e53187f37d41d7180e66db1239b5f9c8846addd
Change-Id: I7396ad4d25fec44000ead88b24e818abc107b5f8
This commit is contained in:
Brendan 2021-04-16 20:55:18 +10:00
parent d48b43054f
commit 9879d3b5db
2 changed files with 5 additions and 0 deletions

View File

@ -41,6 +41,8 @@ provisioner:
tripleo_hosts_entries_undercloud_hosts_entries: []
tripleo_hosts_entries_extra_hosts_entries: []
tripleo_hosts_entries_vip_hosts_entries: []
tripleo_stack_name: overcloud
plan: overcloud
cloud_domain: localdomain
enabled_networks:
- ctlplane

View File

@ -85,6 +85,9 @@
tripleo_hosts_entries_extra_hosts_entries | default([]) %}
{{ host }}
{% endfor %}
marker: "# {mark}"
marker_begin: "START_HOST_ENTRIES_FOR_STACK: {{ tripleo_stack_name | default(plan) }}"
marker_end: "END_HOST_ENTRIES_FOR_STACK: {{ tripleo_stack_name | default(plan) }}"
register: tripleo_hosts_entries_new_entries
tags:
- tripleo_hosts_entries