aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Bourke <paul.bourke@oracle.com>2016-07-05 14:43:03 +0100
committerJeffrey Zhang <jeffrey.zhang@99cloud.net>2016-07-10 05:16:10 +0000
commita479afac4aa2a08fd51b1871c55fdd9dd24dc220 (patch)
tree43825645eed3001e451e2d555d272e9895ebe645
parente255af81ec1f51477ba41b0896acbf304cac6b2b (diff)
downloadkolla-a479afac4aa2a08fd51b1871c55fdd9dd24dc220.tar.gz
kolla-a479afac4aa2a08fd51b1871c55fdd9dd24dc220.zip
Use inventory_hostname for Ceph bootstrap
The inventory_hostname is more reliable than ansible_hostname for the way we use it here. If the deploy node cannot resolve the hostname of a target node (the operator is using IP addresses in their inventory), the bootstrap will fail with: "Host: x.x.x.x, Task: ceph : Fetching Ceph keyrings, Status: unreachable, Message: SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh" Closes-Bug: 1599138 Change-Id: Ic76e4baf8c642c59bbe81e6671ac97bcbb57d470
-rw-r--r--ansible/roles/ceph/tasks/bootstrap_mons.yml2
-rw-r--r--ansible/roles/ceph/tasks/generate_cluster.yml2
2 files changed, 2 insertions, 2 deletions
diff --git a/ansible/roles/ceph/tasks/bootstrap_mons.yml b/ansible/roles/ceph/tasks/bootstrap_mons.yml
index 863069485..2200c4f98 100644
--- a/ansible/roles/ceph/tasks/bootstrap_mons.yml
+++ b/ansible/roles/ceph/tasks/bootstrap_mons.yml
@@ -19,7 +19,7 @@
register: ceph_mon_config_volume
- name: Writing hostname of host with existing cluster files to temp file
- local_action: copy content={{ ansible_hostname }} dest=/tmp/kolla_ceph_cluster mode=0600
+ local_action: copy content="{{ inventory_hostname }}" dest=/tmp/kolla_ceph_cluster mode=0600
changed_when: False
always_run: True
when: not ceph_mon_config_volume.changed
diff --git a/ansible/roles/ceph/tasks/generate_cluster.yml b/ansible/roles/ceph/tasks/generate_cluster.yml
index 77ac8dc94..beb78e587 100644
--- a/ansible/roles/ceph/tasks/generate_cluster.yml
+++ b/ansible/roles/ceph/tasks/generate_cluster.yml
@@ -25,4 +25,4 @@
- name: Setting host for cluster files
set_fact:
- delegate_host: "{{ ansible_hostname }}"
+ delegate_host: "{{ inventory_hostname }}"