2020-02-12 20:58:59 +08:00
|
|
|
---
|
|
|
|
- name: get current mgr backend - ipv4
|
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
mgr_server_addr: "{{ hostvars[dashboard_backend]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}"
|
2020-02-12 20:58:59 +08:00
|
|
|
when: ip_version == 'ipv4'
|
|
|
|
|
|
|
|
- name: get current mgr backend - ipv6
|
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
mgr_server_addr: "{{ hostvars[dashboard_backend]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last }}"
|
2020-02-12 20:58:59 +08:00
|
|
|
when: ip_version == 'ipv6'
|
|
|
|
|
|
|
|
- name: config the current dashboard backend
|
2021-03-03 22:43:50 +08:00
|
|
|
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/{{ hostvars[dashboard_backend]['ansible_facts']['hostname'] }}/server_addr {{ mgr_server_addr }}"
|
2020-02-12 20:58:59 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
changed_when: false
|
|
|
|
run_once: true
|