]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
validate: add checks for grafana-server group definition
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 29 Jul 2019 08:03:48 +0000 (10:03 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 29 Jul 2019 12:42:45 +0000 (14:42 +0200)
this commit adds two checks:
- check that the `[grafana-server]` group is defined
- check that the `[grafana-server]` contains at least one node.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-validate/tasks/main.yml

index fb407ff53c27f4d13648b310498743b157b398e4..916503570e69a915e355c1acf994c3c033ddaf1c 100644 (file)
 - name: include check_nfs.yml
   include_tasks: check_nfs.yml
   when: inventory_hostname in groups.get(nfs_group_name, [])
+
+- block:
+    - name: fail if [grafana-server] group doesn't exist
+      fail:
+        msg: "you must add a [grafana-server] group and add at least one node."
+      when: groups[grafana_server_group_name] is undefined
+
+    - name: fail when [grafana-server] doesn't contain at least one node.
+      fail:
+        msg: "you must add at least one node in the [grafana-server] hosts group"
+      when: groups[grafana_server_group_name] | length < 1
+  when: dashboard_enabled | bool
\ No newline at end of file