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.

40 lines
881 B

  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: 'create monitoring user'
  11. user:
  12. name: 'icinga'
  13. state: 'present'
  14. tags:
  15. - 'monitoring'
  16. - name: 'create monitoring entry'
  17. set_fact:
  18. agent_monitoring_entry: >
  19. {{ {
  20. host_fqdn: {
  21. 'address': ansible_host,
  22. 'agent_type': 'ssh',
  23. }
  24. } }}
  25. tags:
  26. - 'monitoring'
  27. - name: 'update monitoring facts'
  28. set_fact:
  29. monitoring_facts: >
  30. {{ hostvars[monitoring_host]['monitoring_facts']
  31. | default({})
  32. | combine(agent_monitoring_entry, recursive=true) }}
  33. delegate_facts: true
  34. delegate_to: '{{ monitoring_host }}'
  35. tags:
  36. - 'monitoring'
  37. ...