Nagios OK on FreeBSD
parent
729b621ccb
commit
cdc152afbe
|
@ -1,7 +1,7 @@
|
||||||
{% extends "_base.j2" %}
|
{% extends "_base.j2" %}
|
||||||
|
|
||||||
{% block root %}
|
{% block root %}
|
||||||
root /usr/share/nagios3/htdocs;
|
root {{ nginx_nagios_root }};
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block template_try_files %}
|
{% block template_try_files %}
|
||||||
|
@ -17,21 +17,27 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
location /stylesheets {
|
location /stylesheets {
|
||||||
alias /etc/nagios3/stylesheets;
|
{% if nginx_nagios_stylesheets is defined %}
|
||||||
|
alias {{ nginx_nagios_stylesheets }};
|
||||||
|
{% endif %}
|
||||||
expires 60d;
|
expires 60d;
|
||||||
}
|
}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block template_upstream_location %}
|
{% block template_upstream_location %}
|
||||||
|
{% if ansible_distribution == 'Debian' %}
|
||||||
location /cgi-bin/nagios3 {
|
location /cgi-bin/nagios3 {
|
||||||
root /usr/lib;
|
root /usr/lib;
|
||||||
|
{% elif ansible_distribution == 'FreeBSD' %}
|
||||||
|
location /cgi-bin {
|
||||||
|
{% endif %}
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
{% if nginx_version.stdout | version_compare('1.6.1', 'lt') %}
|
{% if nginx_version.stdout | version_compare('1.6.1', 'lt') %}
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
{% else %}
|
{% else %}
|
||||||
include fastcgi.conf;
|
include fastcgi.conf;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
fastcgi_pass unix:/var/run/fcgiwrap.socket;
|
fastcgi_pass unix:{{ nginx_fcgiwrap_sock }};
|
||||||
fastcgi_param AUTH_USER $remote_user;
|
fastcgi_param AUTH_USER $remote_user;
|
||||||
fastcgi_param REMOTE_USER $remote_user;
|
fastcgi_param REMOTE_USER $remote_user;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -262,6 +262,7 @@
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: authbpc
|
register: authbpc
|
||||||
failed_when: authbpc.stdout.find('BackupPC Server Status') == -1
|
failed_when: authbpc.stdout.find('BackupPC Server Status') == -1
|
||||||
|
when: ansible_distribution != 'FreeBSD'
|
||||||
|
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
# Nagios
|
# Nagios
|
||||||
|
@ -272,7 +273,7 @@
|
||||||
register: nagios_php
|
register: nagios_php
|
||||||
failed_when: nagios_php.stdout.find('Nagios Core') == -1
|
failed_when: nagios_php.stdout.find('Nagios Core') == -1
|
||||||
- name: -- VERIFY NAGIOS3 CGI --
|
- 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
|
changed_when: false
|
||||||
register: nagios_cgi
|
register: nagios_cgi
|
||||||
failed_when: nagios_cgi.stdout.find('Nagios Event Summary') == -1
|
failed_when: nagios_cgi.stdout.find('Nagios Event Summary') == -1
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
nginx_events_use: 'epoll'
|
nginx_events_use: 'epoll'
|
||||||
nginx_pid: '/run/nginx.pid'
|
nginx_pid: '/run/nginx.pid'
|
||||||
nginx_etc_dir: '/etc/nginx'
|
nginx_etc_dir: '/etc/nginx'
|
||||||
|
|
||||||
|
# Specific vhosts
|
||||||
|
nginx_nagios_root: '/usr/share/nagios3/htdocs'
|
||||||
|
nginx_nagios_stylesheets: '/etc/nagios3/stylesheets'
|
||||||
|
nginx_fcgiwrap_sock: '/var/run/fcgiwrap.socket'
|
||||||
|
|
|
@ -2,4 +2,6 @@ nginx_events_use: 'kqueue'
|
||||||
nginx_pid: '/var/run/nginx.pid'
|
nginx_pid: '/var/run/nginx.pid'
|
||||||
nginx_etc_dir: '/usr/local/etc/nginx'
|
nginx_etc_dir: '/usr/local/etc/nginx'
|
||||||
|
|
||||||
# TODO: it's a dirty to force variable here!
|
# Specific vhosts
|
||||||
|
nginx_nagios_root: '/usr/local/www/nagios'
|
||||||
|
nginx_fcgiwrap_sock: '/var/run/fcgiwrap/fcgiwrap.sock'
|
||||||
|
|
Loading…
Reference in New Issue