From 6d894e556cad040b463fc7ad8cd634bb04954450 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Wed, 23 Aug 2017 19:09:49 +0200 Subject: [PATCH] ceph-mon: remove hardcoded ipv4 in containers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Before this commit we were forcing ipv4 which might not be available. Now setting ip_version to ipv4 or ipv6 will give you the right support. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1484189 Signed-off-by: Sébastien Han --- roles/ceph-mon/tasks/docker/main.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/roles/ceph-mon/tasks/docker/main.yml b/roles/ceph-mon/tasks/docker/main.yml index 1b5291526..8813295fd 100644 --- a/roles/ceph-mon/tasks/docker/main.yml +++ b/roles/ceph-mon/tasks/docker/main.yml @@ -8,14 +8,25 @@ delay: 15 until: monitor_socket.rc == 0 -- name: force peer addition as potential bootstrap peer for cluster bringup +- name: ipv4 - force peer addition as potential bootstrap peer for cluster bringup command: docker exec ceph-mon-{{ ansible_hostname }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ hostvars[item]['ansible_' + monitor_interface].ipv4.address }} with_items: "{{ groups[mon_group_name] }}" changed_when: false failed_when: false when: - - "{{ inventory_hostname == groups[mon_group_name][0] }}" + - inventory_hostname == groups[mon_group_name][0] - not containerized_deployment_with_kv + - ip_version == 'ipv4' + +- name: ipv6 - force peer addition as potential bootstrap peer for cluster bringup + command: docker exec ceph-mon-{{ ansible_hostname }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint [{{ hostvars[item]['ansible_' + monitor_interface].ipv6[0].address }}] + with_items: "{{ groups[mon_group_name] }}" + changed_when: false + failed_when: false + when: + - inventory_hostname == groups[mon_group_name][0] + - not containerized_deployment_with_kv + - ip_version == 'ipv6' - include: copy_configs.yml when: not containerized_deployment_with_kv -- 2.39.5