From 073131d8a630846bb8f13291db12bb2f690a4479 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 15 Oct 2018 15:23:32 +0200 Subject: [PATCH] mon: refact docker/main.yml since the jinja logic has been moved into ansible task, we can simply this part of the code and use `_current_monitor_address` Signed-off-by: Guillaume Abrioux --- roles/ceph-mon/tasks/docker/main.yml | 57 +--------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) diff --git a/roles/ceph-mon/tasks/docker/main.yml b/roles/ceph-mon/tasks/docker/main.yml index 41d30bd4e..898f31f55 100644 --- a/roles/ceph-mon/tasks/docker/main.yml +++ b/roles/ceph-mon/tasks/docker/main.yml @@ -16,65 +16,12 @@ delay: 15 until: monitor_socket.rc == 0 -- name: ipv4 - force peer addition as potential bootstrap peer for cluster bringup - monitor_interface - command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ hostvars[groups[mon_group_name][0]]['ansible_' + monitor_interface].ipv4.address }}" +- name: force peer addition as potential bootstrap peer for cluster bringup + command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ _current_monitor_address }}" changed_when: false failed_when: false when: - not containerized_deployment_with_kv - - ip_version == 'ipv4' - - hostvars[groups[mon_group_name][0]]['monitor_interface'] is defined - - hostvars[groups[mon_group_name][0]]['monitor_interface'] != 'interface' - -- name: ipv4 - force peer addition as potential bootstrap peer for cluster bringup - monitor_address - command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ hostvars[groups[mon_group_name][0]]['monitor_address'] }}" - changed_when: false - failed_when: false - when: - - not containerized_deployment_with_kv - - ip_version == 'ipv4' - - hostvars[groups[mon_group_name][0]]['monitor_address'] is defined - - hostvars[groups[mon_group_name][0]]['monitor_address'] != '0.0.0.0' - -- name: ipv4 - force peer addition as potential bootstrap peer for cluster bringup - monitor_address_block - command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ hostvars[groups[mon_group_name][0]]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}" - changed_when: false - failed_when: false - when: - - not containerized_deployment_with_kv - - ip_version == 'ipv4' - - hostvars[groups[mon_group_name][0]]['monitor_address_block'] is defined - - hostvars[groups[mon_group_name][0]]['monitor_address_block'] != 'subnet' - -- name: ipv6 - force peer addition as potential bootstrap peer for cluster bringup - monitor_interface - command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint [{{ hostvars[groups[mon_group_name][0]]['ansible_' + monitor_interface].ipv6[0].address }}]" - changed_when: false - failed_when: false - when: - - not containerized_deployment_with_kv - - ip_version == 'ipv6' - - hostvars[groups[mon_group_name][0]]['monitor_interface'] is defined - - hostvars[groups[mon_group_name][0]]['monitor_interface'] != 'interface' - -- name: ipv6 - force peer addition as potential bootstrap peer for cluster bringup - monitor_address - command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint [{{ hostvars[groups[mon_group_name][0]]['monitor_address'] }}]" - changed_when: false - failed_when: false - when: - - not containerized_deployment_with_kv - - ip_version == 'ipv6' - - hostvars[groups[mon_group_name][0]]['monitor_address'] is defined - - hostvars[groups[mon_group_name][0]]['monitor_address'] != '0.0.0.0' - -- name: ipv6 - force peer addition as potential bootstrap peer for cluster bringup - monitor_address_block - command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint [{{ hostvars[groups[mon_group_name][0]]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}]" - changed_when: false - failed_when: false - when: - - not containerized_deployment_with_kv - - ip_version == 'ipv6' - - hostvars[groups[mon_group_name][0]]['monitor_address_block'] is defined - - hostvars[groups[mon_group_name][0]]['monitor_address_block'] != 'subnet' - name: include fetch_configs.yml include_tasks: fetch_configs.yml