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
This commit is contained in:
parent
0a82a97f89
commit
0c0ea09be7
|
@ -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…
Reference in New Issue