From: Guillaume Abrioux Date: Mon, 29 Jul 2019 08:03:48 +0000 (+0200) Subject: validate: add checks for grafana-server group definition X-Git-Tag: v4.0.0rc13~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea44783f3d274a3477658ad9d90a1745fe04dacb;p=ceph-ansible.git validate: add checks for grafana-server group definition 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 (cherry picked from commit 02beb0091612c8cd339e1404c8c44c081a46b807) --- diff --git a/roles/ceph-validate/tasks/main.yml b/roles/ceph-validate/tasks/main.yml index fb407ff53..916503570 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -105,3 +105,15 @@ - 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