diff --git a/tasks/main.yml b/tasks/main.yml index 9b8c1aa..fb953a2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,6 +4,7 @@ that: - monitored_dont|default(False) != True - monitored_by_nrpe == True or monitored_by_ssh == True + fail_msg: "Neither monitored_by_nrpe nor monitored_by_ssh set to True" - name: Gather OS Specific Variables include_vars: "{{ item }}" diff --git a/tasks/ssh.yml b/tasks/ssh.yml index 1a6cd72..a48f8dc 100644 --- a/tasks/ssh.yml +++ b/tasks/ssh.yml @@ -1,4 +1,10 @@ --- +- name: Sanity check + assert: + that: + - monitored_ssh_key_files|length > 0 + fail_msg: "List of SSH keys ('monitored_ssh_key_files') is empty!" + - name: Copy SSH authorized_keys for monitoring user authorized_key: user: "{{ monitored_user }}"