Skip to content

Commit d1e4b83

Browse files
committed
dashboard: always set dashboard_server_addr
When running the playbook with `--limit`, if the play targeted doesn't match hosts present in the mgr group the playbook can fail. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2063029 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 72e4654)
1 parent cf44ad7 commit d1e4b83

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

roles/ceph-dashboard/tasks/configure_dashboard.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@
1010

1111
- name: get current mgr backend - ipv4
1212
set_fact:
13-
dashboard_server_addr: "{{ ansible_facts['all_ipv4_addresses'] | ips_in_ranges(dashboard_network.split(',')) | first }}"
13+
dashboard_server_addr: "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(dashboard_network.split(',')) | first }}"
1414
when: ip_version == 'ipv4'
15+
loop: "{{ groups.get(mgr_group_name) if groups.get(mgr_group_name, []) | length > 0 else groups.get(mon_group_name) }}"
16+
delegate_to: "{{ item }}"
17+
delegate_facts: True
1518

1619
- name: get current mgr backend - ipv6
1720
set_fact:
18-
dashboard_server_addr: "{{ ansible_facts['all_ipv6_addresses'] | ips_in_ranges(dashboard_network.split(',')) | last }}"
21+
dashboard_server_addr: "{{ hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(dashboard_network.split(',')) | last }}"
1922
when: ip_version == 'ipv6'
23+
loop: "{{ groups.get(mgr_group_name) if groups.get(mgr_group_name, []) | length > 0 else groups.get(mon_group_name) }}"
24+
delegate_to: "{{ item }}"
25+
delegate_facts: True
2026

2127
- name: disable SSL for dashboard
2228
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/ssl false"

0 commit comments

Comments
 (0)