From f2ff33a8d9451c18fe5c332771194ccce3cdb911 Mon Sep 17 00:00:00 2001 From: Jakub Krol Date: Sat, 13 Jan 2018 16:46:08 +0100 Subject: [PATCH 1/2] Add preflight checks --- tasks/main.yml | 2 ++ tasks/preflight.yml | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 tasks/preflight.yml diff --git a/tasks/main.yml b/tasks/main.yml index 74b34f4..2622870 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,6 @@ --- +- include: preflight.yml + - name: Create the Node Exporter group group: name: "node-exp" diff --git a/tasks/preflight.yml b/tasks/preflight.yml new file mode 100644 index 0000000..fc2048f --- /dev/null +++ b/tasks/preflight.yml @@ -0,0 +1,7 @@ +--- +- name: check collectors + fail: + msg: "Collector cannot be both disabled and enabled" + when: "{{ item }} in {{ node_exporter_enabled_collectors }}" + with_items: "{{ node_exporter_disabled_collectors }}" + From 9095a3d76a45368e3f8308e5dbac4576702205fc Mon Sep 17 00:00:00 2001 From: jkrol2 <30313615+jkrol2@users.noreply.github.com> Date: Sat, 13 Jan 2018 16:58:46 +0100 Subject: [PATCH 2/2] Update preflight.yml --- tasks/preflight.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasks/preflight.yml b/tasks/preflight.yml index fc2048f..4587982 100644 --- a/tasks/preflight.yml +++ b/tasks/preflight.yml @@ -2,6 +2,5 @@ - name: check collectors fail: msg: "Collector cannot be both disabled and enabled" - when: "{{ item }} in {{ node_exporter_enabled_collectors }}" + when: '"{{ item }}" in "{{ node_exporter_enabled_collectors }}"' with_items: "{{ node_exporter_disabled_collectors }}" -