Remove old Heat hosts entries in tripleo-hosts-entries

For upgrades, this role now takes care of removing the old Heat entries
if they are present in /etc/hosts. The test prepare process has been
updated to create a temp file that would replicate what we'd expect
in a live system.

Change-Id: Ifc4d9553b74e6e6a9794902b418f54c0cfc7a39d
changes/69/691969/2
James Slagle 3 years ago committed by Kevin Carter
parent 0a82a97f89
commit 0c0ea09be7
No known key found for this signature in database
GPG Key ID: CE94BD890A47B20A
  1. 10
      tripleo_ansible/roles/tripleo-hosts-entries/molecule/default/prepare.yml
  2. 13
      tripleo_ansible/roles/tripleo-hosts-entries/tasks/main.yml

@ -14,8 +14,16 @@
# License for the specific language governing permissions and limitations
# under the License.
- name: Prepare
hosts: all
roles:
- role: test_deps
post_tasks:
- name: Create temp host file
copy:
content: |
HEAT_HOSTS_START - Do not edit manually within this section!
0.0.0.0 test test.domain.local
0.0.0.1 test test.domain.local
HEAT_HOSTS_END
dest: "{{ tripleo_hosts_entries_hosts_path }}"

@ -14,6 +14,19 @@
# License for the specific language governing permissions and limitations
# under the License.
- name: Remove old Heat hosts configuration (if present)
become: true
blockinfile:
state: absent
path: "{{ tripleo_hosts_entries_hosts_path }}"
block: ""
marker: "# {mark}"
marker_begin: "HEAT_HOSTS_START - Do not edit manually within this section!"
marker_end: "HEAT_HOSTS_END"
tags:
- tripleo_hosts_entries
- name: Update /etc/hosts
become: true
blockinfile:

Loading…
Cancel
Save