Fix error when /etc/hosts does not exist
Even though this might seem very rare/unusual/non-acceptable
there are cases where the /etc/hosts file does not exist
(or has been moved temporarily). This fix prevents error
from being raised. This furthermore ensure idem-potency
as without the fix, using the role after failure just
works because /etc/hosts has now been created.
Change-Id: Ied4875d4fc6754bb262496e69b231b192166b23c
(cherry picked from commit d5d516ee7c
)
This commit is contained in:
parent
6b4a115ab0
commit
e98b5bb0c7
@ -37,4 +37,4 @@
|
||||
- name: Update hosts file
|
||||
command: "/usr/local/bin/openstack-host-hostfile-setup.sh"
|
||||
register: update_hosts
|
||||
changed_when: stat_hosts.stat.md5 | string != update_hosts.stdout | string
|
||||
changed_when: not stat_hosts.stat.exists or stat_hosts.stat.md5 | string != update_hosts.stdout | string
|
||||
|
Loading…
Reference in New Issue
Block a user