EvoBSD/roles/nagios-nrpe/tasks/main.yml
Jérémy Dubois cdc811b3de
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
New NRPE check : check_packetfilter
2020-07-28 17:43:24 +02:00

70 lines
1.6 KiB
YAML

---
- name: Install nrpe
openbsd_pkg:
name:
- nrpe--
state: present
- name: Install monitoring-plugins
openbsd_pkg:
name:
- monitoring-plugins
state: present
- name: Create nrpe.d dir
file:
path: /etc/nrpe.d
state: directory
owner: root
group: wheel
mode: "0755"
- name: Include nrpe.d dir in nrpe.cfg
lineinfile:
dest: /etc/nrpe.cfg
line: 'include_dir=/etc/nrpe.d'
- name: custom configuration is present
template:
src: evolix_bsd.cfg.j2
dest: /etc/nrpe.d/evolix.cfg
notify: restart nrpe
- name: Nagios plugins are installed
copy:
src: plugins_bsd/{{ item.name }}
dest: /usr/local/libexec/nagios/plugins/{{ item.name }}
owner: root
group: wheel
mode: "0755"
force: "{{ item.force }}"
with_items:
- {name: 'check_carp_if', force: true}
- {name: 'check_connections_state.sh', force: false}
- {name: 'check_ipsecctl.sh', force: false}
- {name: 'check_openbgpd', force: true}
- {name: 'check_openvpn', force: false}
- {name: 'check_openvpn.pl', force: true}
- {name: 'check_ospfd_simple', force: true}
- {name: 'check_packetfilter', force: true}
notify: restart nrpe
- name: Nagios plugins are installed - template
template:
src: plugins_bsd/{{ item.name }}.j2
dest: /usr/local/libexec/nagios/plugins/{{ item.name }}
owner: root
group: wheel
mode: "0755"
force: "{{ item.force }}"
with_items:
- {name: 'check_pf_states', force: false}
- {name: 'check_free_mem.sh', force: true}
notify: restart nrpe
- name: Starting and enabling nrpe
service:
name: nrpe
enabled: true
state: started