From ea44783f3d274a3477658ad9d90a1745fe04dacb Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 29 Jul 2019 10:03:48 +0200 Subject: [PATCH] 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) --- roles/ceph-validate/tasks/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 2.39.5