main.yml 875 B

123456789101112131415161718192021222324252627
  1. ---
  2. - fail: msg="This system should not be monitored"
  3. when: monitored_dont is defined
  4. - fail: msg="Neither monitored_by_(ssh|nrpe) is set"
  5. when: monitored_by_nrpe == False and monitored_by_ssh == False
  6. - name: Gather OS Specific Variables
  7. include_vars: "{{ item }}"
  8. with_first_found:
  9. - "{{ (ansible_distribution|lower).split(' ')[0] }}-{{ (ansible_distribution_version|lower).split(' ')[0] }}.yml"
  10. - "{{ (ansible_distribution|lower).split(' ')[0] }}-{{ (ansible_distribution_major_version|lower).split(' ')[0] }}.yml"
  11. - "{{ (ansible_distribution|lower).split(' ')[0] }}.yml"
  12. - "{{ (ansible_os_family|lower).split(' ')[0] }}.yml"
  13. - "defaults.yml"
  14. - include: user.yml
  15. - include: packages.yml
  16. when: monitored_packages_install != False
  17. - include: nrpe.yml
  18. when: monitored_by_nrpe == True
  19. - include: ssh.yml
  20. when: monitored_by_ssh == True