Nagios OK on FreeBSD

This commit is contained in:
Emilien Mantel
2016-03-05 18:34:04 +01:00
parent 729b621ccb
commit cdc152afbe
5 changed files with 48 additions and 5 deletions

View File

@@ -1,2 +1,31 @@
---
- name: APT | Install web apps
pkgng: pkg={{ item }} state=present
with_items:
- nagios
- backuppc
- name: COMMAND | Activate backuppc config
command: >
cp /usr/local/etc/backuppc/config.pl.sample /usr/local/etc/backuppc/config.pl
creates=/usr/local/etc/backuppc/config.pl
- name: FILE | Fix backuppc permissions
file: >
path=/usr/local/etc/backuppc/config.pl
owner=backuppc
group=backuppc
- name: FILE | Fix fcgiwrap permission
file: >
path={{ nginx_fcgiwrap_sock }}
mode=0640
owner={{ nginx_user }}
group={{ nginx_user }}
#
# We don't manage BackupPC on FreeBSD... too dirty. :/
#
#- name: SERVICE | Ensure backuppc is started
# service: name=backuppc state=started enabled=yes

View File

@@ -262,6 +262,7 @@
changed_when: false
register: authbpc
failed_when: authbpc.stdout.find('BackupPC Server Status') == -1
when: ansible_distribution != 'FreeBSD'
# --------------------------------
# Nagios
@@ -272,7 +273,7 @@
register: nagios_php
failed_when: nagios_php.stdout.find('Nagios Core') == -1
- name: -- VERIFY NAGIOS3 CGI --
command: "curl -u nagiosadmin:nagios -H 'Host: nagios3.local' http://127.0.0.1/cgi-bin/nagios3/summary.cgi"
command: "curl -u nagiosadmin:nagios -H 'Host: nagios3.local' http://127.0.0.1/cgi-bin{% if ansible_distribution == 'Debian' %}/nagios3{% endif %}/summary.cgi"
changed_when: false
register: nagios_cgi
failed_when: nagios_cgi.stdout.find('Nagios Event Summary') == -1