]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add ability to enable ceph mgr modules. 2053/head
authorFabien Brachere <fabien.brachere@ariane.network>
Mon, 16 Oct 2017 13:04:23 +0000 (15:04 +0200)
committerFabien Brachere <fabien.brachere@ariane.network>
Mon, 16 Oct 2017 13:04:23 +0000 (15:04 +0200)
group_vars/mgrs.yml.sample
roles/ceph-mgr/defaults/main.yml
roles/ceph-mgr/tasks/main.yml

index a7f10dbef57769446e97894dd45c38347aec42dd..d26749e1f67f511d8af8ca030864cdc9c83d6db3 100644 (file)
@@ -7,6 +7,12 @@
 # file as a good configuration file when no variable in it.
 dummy:
 
+###########
+# MODULES #
+###########
+# Ceph mgr modules to enable, current modules available are: status,dashboard,localpool,restful,zabbix,prometheus,influx
+#ceph_mgr_modules: [status]
+
 ##########
 # DOCKER #
 ##########
index 57300559b5791343c921f215436839260f852263..e0b0c98a97235bb8b424d170ed0180a2faedc15a 100644 (file)
@@ -1,4 +1,10 @@
 ---
+###########
+# MODULES #
+###########
+# Ceph mgr modules to enable, current modules available are: status,dashboard,localpool,restful,zabbix,prometheus,influx
+ceph_mgr_modules: [status]
+
 ##########
 # DOCKER #
 ##########
index e3a0bb244d6cef280d152ef11e6bb99ce9d820c4..fabef8e08e63a0ae8cdffec39459a41c85142641 100644 (file)
@@ -1,7 +1,7 @@
 ---
 - name: set_fact docker_exec_cmd
   set_fact:
-    docker_exec_cmd: "docker exec ceph-mgr-{{ ansible_hostname }}"
+    docker_exec_cmd_mgr: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
   when:
     - containerized_deployment
 
 - name: include docker/main.yml
   include: docker/main.yml
   when: containerized_deployment
+
+- name: get enabled modules from ceph-mgr
+  command: "{{ docker_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} --format json mgr module ls"
+  register: enabled_ceph_mgr_modules
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+
+- name: disable ceph mgr enabled modules
+  command: "{{ docker_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} mgr module disable {{ item }}"
+  with_items: "{{ enabled_ceph_mgr_modules.stdout | from_json }}"
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+
+- name: add modules to ceph-mgr
+  command: "{{ docker_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} mgr module enable {{ item }}"
+  with_items: "{{ ceph_mgr_modules }}"
+  delegate_to: "{{ groups[mon_group_name][0] }}"