kolla-ansible/ansible/roles/ceph/tasks/bootstrap_mons.yml
Paul Bourke a479afac4a 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
2016-07-10 05:16:10 +00:00

39 lines
1.2 KiB
YAML

---
- name: Cleaning up temp file on localhost
local_action: file path=/tmp/kolla_ceph_cluster state=absent
changed_when: False
always_run: True
run_once: True
- name: Creating temp file on localhost
local_action: copy content=None dest=/tmp/kolla_ceph_cluster mode=0600
changed_when: False
always_run: True
run_once: True
- name: Creating ceph_mon_config volume
kolla_docker:
action: "create_volume"
common_options: "{{ docker_common_options }}"
name: "ceph_mon_config"
register: ceph_mon_config_volume
- name: Writing hostname of host with existing cluster files to temp file
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
- name: Registering host from temp file
set_fact:
delegate_host: "{{ lookup('file', '/tmp/kolla_ceph_cluster') }}"
- name: Cleaning up temp file on localhost
local_action: file path=/tmp/kolla_ceph_cluster state=absent
changed_when: False
always_run: True
run_once: True
- include: generate_cluster.yml
when: delegate_host == 'None' and inventory_hostname == groups['ceph-mon'][0]