]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
docker: fix monitor addition on kraken 1267/head
authorSébastien Han <seb@redhat.com>
Thu, 2 Feb 2017 21:52:24 +0000 (22:52 +0100)
committerSébastien Han <seb@redhat.com>
Fri, 3 Feb 2017 10:35:54 +0000 (11:35 +0100)
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 <seb@redhat.com>
roles/ceph-mon/tasks/docker/main.yml

index fdf91156e3f06ea0a6db5820b2cae5a90eeb8a56..15499e6e201c381f33c43b225a6d650222686489 100644 (file)
 
 - 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