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