aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Belanger <pabelanger@redhat.com>2016-04-08 09:13:52 -0400
committerPaul Belanger <pabelanger@redhat.com>2016-04-11 15:38:04 +0000
commit84a0f2dd5bb537bcae92c172fcf1bc42d266ec5c (patch)
treec3f72d7a694fcec2ef21e4aeb7158049b9aa06e4
parent928551ba8369b31d013fad22eafa8248e5a293cd (diff)
downloadkolla-84a0f2dd5bb537bcae92c172fcf1bc42d266ec5c.tar.gz
kolla-84a0f2dd5bb537bcae92c172fcf1bc42d266ec5c.zip
Make sure /etc/hostname is valid for SELinux
In the gate, it is possible for /etc/hostname to not have a valid SELinux security conext. So, reset them to default before we update the hostname to avoid: TASK: [Assign hostname] failed: [node1] => {"failed": true} msg: Command failed rc=1, out=, err=Could not set property: Access denied Closes-Bug: #1568047 Change-Id: Ie30c8437b310d1ea5bc75307375c255131dfe934 Needed-By: I2ff5fbb315832b8cf07c93d0dd0cdaacd958631e
-rw-r--r--tools/setup_nodes.yml4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/setup_nodes.yml b/tools/setup_nodes.yml
index d37cdaab3..b61f126df 100644
--- a/tools/setup_nodes.yml
+++ b/tools/setup_nodes.yml
@@ -7,6 +7,10 @@
src: /etc/hosts
dest: /etc/hosts
+ - name: Ensure /etc/hostname is valid for SELinux
+ command: restorecon -v /etc/hostname
+ when: ansible_os_family == 'RedHat'
+
- name: Assign hostname
hostname:
name: "{{ inventory_hostname }}"