kolla/ansible/roles/ceph/tasks/generate_cluster.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

29 lines
968 B
YAML

---
- name: Generating initial Ceph keyrings and monmap
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
detach: False
environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
MON_IP: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}"
HOSTNAME: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}"
image: "{{ ceph_mon_image_full }}"
labels:
BOOTSTRAP:
name: "bootstrap_ceph_mon"
restart_policy: "never"
volumes:
- "{{ node_config_directory }}/ceph-mon/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "ceph_mon:/var/lib/ceph"
- "ceph_mon_config:/etc/ceph"
- "kolla_logs:/var/log/kolla/"
- include: start_mons.yml
- name: Setting host for cluster files
set_fact:
delegate_host: "{{ inventory_hostname }}"