icinga_agent: [WIP]
This commit is contained in:
parent
b99c41b938
commit
51e673ca94
10
roles/icinga_agent/handlers/main.yml
Normal file
10
roles/icinga_agent/handlers/main.yml
Normal 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
|
@ -57,6 +57,18 @@
|
|||||||
- --accept-config
|
- --accept-config
|
||||||
when: not cert_file.stat.exists
|
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
|
# TODO expand this to cover more than just the root partition
|
||||||
- name: Monitor disks
|
- name: Monitor disks
|
||||||
include_role: name=icinga-monitor tasks_from=disk
|
include_role: name=icinga-monitor tasks_from=disk
|
||||||
|
3
roles/icinga_agent/templates/hosts.agent.j2
Normal file
3
roles/icinga_agent/templates/hosts.agent.j2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
/* Set custom variable `agent_endpoint` for use in `services.conf`. */
|
||||||
|
vars.agent_endpoint = "{{ inventory_hostname }}"
|
Loading…
Reference in New Issue
Block a user