Browse Source

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
changes/23/786623/5
Brendan 2 months ago
parent
commit
9879d3b5db
2 changed files with 5 additions and 0 deletions
  1. +2
    -0
      tripleo_ansible/roles/tripleo_hosts_entries/molecule/default/molecule.yml
  2. +3
    -0
      tripleo_ansible/roles/tripleo_hosts_entries/tasks/main.yml

+ 2
- 0
tripleo_ansible/roles/tripleo_hosts_entries/molecule/default/molecule.yml 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


+ 3
- 0
tripleo_ansible/roles/tripleo_hosts_entries/tasks/main.yml 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


Loading…
Cancel
Save