Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.0 KiB

  1. ---
  2. - name: 'install monitoring agent requirements'
  3. apt:
  4. pkg: 'monitoring-plugins-basic'
  5. state: 'present'
  6. update_cache: true
  7. cache_valid_time: 3600
  8. tags:
  9. - 'packages'
  10. - name: 'add monitoring plugin - check_mem.pl'
  11. copy:
  12. src: 'check_mem.pl'
  13. dest: '/usr/lib/nagios/plugins/check_mem.pl'
  14. mode: '0755'
  15. - name: 'create monitoring user'
  16. user:
  17. name: 'icinga'
  18. state: 'present'
  19. tags:
  20. - 'monitoring'
  21. - name: 'create monitoring entry'
  22. set_fact:
  23. agent_monitoring_entry: >
  24. {{ {
  25. host_fqdn: {
  26. 'address': ansible_host,
  27. 'agent_type': 'ssh',
  28. }
  29. } }}
  30. tags:
  31. - 'monitoring'
  32. - name: 'update monitoring facts'
  33. set_fact:
  34. monitoring_facts: >
  35. {{ hostvars[monitoring_host]['monitoring_facts']
  36. | default({})
  37. | combine(agent_monitoring_entry, recursive=true) }}
  38. delegate_facts: true
  39. delegate_to: '{{ monitoring_host }}'
  40. tags:
  41. - 'monitoring'
  42. ...