From 2ed93875a91a62213dc78511edd8ba61a2e3740a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Thu, 2 Feb 2017 22:52:24 +0100 Subject: [PATCH] docker: fix monitor addition on kraken MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Probably not the best fix but useful for testing. We will remove this once we find a better workaround. Signed-off-by: Sébastien Han --- roles/ceph-mon/tasks/docker/main.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/roles/ceph-mon/tasks/docker/main.yml b/roles/ceph-mon/tasks/docker/main.yml index fdf91156e..15499e6e2 100644 --- a/roles/ceph-mon/tasks/docker/main.yml +++ b/roles/ceph-mon/tasks/docker/main.yml @@ -62,13 +62,21 @@ - include: start_docker_monitor.yml -# NOTE: if we don't wait we will attempt to copy config to ansible host -# before admin key is ready, preventing future daemons e.g. ceph-mds from -# properly retrieving key -- name: "wait for {{ cluster }}.client.admin.keyring exists" - wait_for: - path: /etc/ceph/{{ cluster }}.client.admin.keyring - when: cephx +- name: wait for monitor socket to exist + command: docker exec {{ ansible_hostname }} stat /var/run/ceph/{{ cluster }}-mon.{{ ansible_hostname }}.asok + register: monitor_socket + retries: 5 + delay: 10 + until: monitor_socket.rc == 0 + +- name: force peer addition as potential bootstrap peer for cluster bringup + command: docker exec {{ ansible_hostname }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ ansible_hostname }}.asok add_bootstrap_peer_hint {{ hostvars[item]['ansible_' + ceph_mon_docker_interface].ipv4.address }} + with_items: "{{ groups.mons }}" + changed_when: false + failed_when: false + when: + - inventory_hostname == groups.mons[0] + - not mon_containerized_deployment_with_kv - include: copy_configs.yml when: not mon_containerized_deployment_with_kv -- 2.39.5