From cd06e7c046b3e56920b1f9bdc1907429382bee5c Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Thu, 15 Jul 2021 15:38:07 -0400 Subject: [PATCH] ceph-mgr: move mgr module list to common Populating the ceph_mgr_modules list in the mgr_modules doesn't make sense since that file is only executed if the list isn't empty or we're using the dashboard. Signed-off-by: Dimitri Savineau --- roles/ceph-mgr/tasks/common.yml | 5 +++++ roles/ceph-mgr/tasks/main.yml | 2 +- roles/ceph-mgr/tasks/mgr_modules.yml | 5 ----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/ceph-mgr/tasks/common.yml b/roles/ceph-mgr/tasks/common.yml index 0566388527..d0690d1317 100644 --- a/roles/ceph-mgr/tasks/common.yml +++ b/roles/ceph-mgr/tasks/common.yml @@ -90,3 +90,8 @@ group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}" mode: "{{ ceph_keyring_permissions }}" when: cephx | bool + +- name: append dashboard modules to ceph_mgr_modules + set_fact: + ceph_mgr_modules: "{{ ceph_mgr_modules | union(['dashboard', 'prometheus']) }}" + when: dashboard_enabled | bool diff --git a/roles/ceph-mgr/tasks/main.yml b/roles/ceph-mgr/tasks/main.yml index c67c0833f6..0395a9cd29 100644 --- a/roles/ceph-mgr/tasks/main.yml +++ b/roles/ceph-mgr/tasks/main.yml @@ -21,6 +21,6 @@ - name: include mgr_modules.yml include_tasks: mgr_modules.yml when: - - ceph_mgr_modules | length > 0 or dashboard_enabled | bool + - ceph_mgr_modules | length > 0 - ((groups[mgr_group_name] | default([]) | length == 0 and inventory_hostname == groups[mon_group_name] | last) or (groups[mgr_group_name] | default([]) | length > 0 and inventory_hostname == groups[mgr_group_name] | last)) diff --git a/roles/ceph-mgr/tasks/mgr_modules.yml b/roles/ceph-mgr/tasks/mgr_modules.yml index 31ddf5ef88..0f1c542830 100644 --- a/roles/ceph-mgr/tasks/mgr_modules.yml +++ b/roles/ceph-mgr/tasks/mgr_modules.yml @@ -1,9 +1,4 @@ --- -- name: append dashboard modules to ceph_mgr_modules - set_fact: - ceph_mgr_modules: "{{ ceph_mgr_modules | union(['dashboard', 'prometheus']) }}" - when: dashboard_enabled | bool - - name: wait for all mgr to be up command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} mgr dump -f json" register: mgr_dump