icinga_agent: [WIP]

This commit is contained in:
Markus 2024-03-11 18:23:42 +01:00
parent b99c41b938
commit 51e673ca94
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,10 @@
---
- name: Run acertmgr
command: /usr/bin/acertmgr
- name: Restart icinga2
service: name=icinga2 state=restarted
- name: Restart nginx
service: name=nginx state=restarted

View File

@ -57,6 +57,18 @@
- --accept-config
when: not cert_file.stat.exists
- name: Set agent address on master
template: src=hosts.agent.j2 dest=/etc/icinga2/conf.d/hosts/{{ inventory_hostname }}.01_agent owner={{ icinga_user }} group={{ icinga_group }}
delegate_to: "{{ icinga_server }}"
- name: Regenerate hosts.conf
assemble:
src: /etc/icinga2/conf.d/hosts
dest: /etc/icinga2/conf.d/hosts.conf
# validate: /usr/sbin/icinga2 daemon -c %s --validate
notify: Restart icinga2
delegate_to: "{{ icinga_server }}"
# TODO expand this to cover more than just the root partition
- name: Monitor disks
include_role: name=icinga-monitor tasks_from=disk

View File

@ -0,0 +1,3 @@
/* Set custom variable `agent_endpoint` for use in `services.conf`. */
vars.agent_endpoint = "{{ inventory_hostname }}"