Fix Nagios vhost and better tests
parent
be349ec686
commit
c357658c25
|
@ -5,7 +5,6 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block template_try_files %}
|
{% block template_try_files %}
|
||||||
try_files $uri $uri/;
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block template_index %}
|
{% block template_index %}
|
||||||
|
@ -21,18 +20,18 @@
|
||||||
alias /etc/nagios3/stylesheets;
|
alias /etc/nagios3/stylesheets;
|
||||||
expires 60d;
|
expires 60d;
|
||||||
}
|
}
|
||||||
location /nagios3 {
|
|
||||||
alias /usr/share/nagios3/htdocs;
|
|
||||||
}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block template_upstream_location %}
|
{% block template_upstream_location %}
|
||||||
location ~ \.cgi$ {
|
location /cgi-bin/nagios3 {
|
||||||
alias /usr/lib/cgi-bin/nagios3;
|
root /usr/lib;
|
||||||
gzip off;
|
try_files $uri =404;
|
||||||
include /etc/nginx/fastcgi_params;
|
{% if nginx_version.stdout | version_compare('1.6.1', 'lt') %}
|
||||||
|
include fastcgi_params;
|
||||||
|
{% else %}
|
||||||
|
include fastcgi.conf;
|
||||||
|
{% endif %}
|
||||||
fastcgi_pass unix:/var/run/fcgiwrap.socket;
|
fastcgi_pass unix:/var/run/fcgiwrap.socket;
|
||||||
fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nagios3$fastcgi_script_name;
|
|
||||||
fastcgi_param AUTH_USER $remote_user;
|
fastcgi_param AUTH_USER $remote_user;
|
||||||
fastcgi_param REMOTE_USER $remote_user;
|
fastcgi_param REMOTE_USER $remote_user;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,11 @@
|
||||||
state: 'absent'
|
state: 'absent'
|
||||||
- name: 'hanx'
|
- name: 'hanx'
|
||||||
password: 'qwerty'
|
password: 'qwerty'
|
||||||
|
- name: 'nagios'
|
||||||
|
description: 'Please login to Nagios!'
|
||||||
|
users:
|
||||||
|
- name: 'nagiosadmin'
|
||||||
|
password: 'nagios'
|
||||||
- name: 'deleteme'
|
- name: 'deleteme'
|
||||||
description: 'Please login!'
|
description: 'Please login!'
|
||||||
users: []
|
users: []
|
||||||
|
@ -145,7 +150,7 @@
|
||||||
htpasswd: 'hello'
|
htpasswd: 'hello'
|
||||||
- name: 'nagios3.local'
|
- name: 'nagios3.local'
|
||||||
template: '_nagios3'
|
template: '_nagios3'
|
||||||
htpasswd: 'hello'
|
htpasswd: 'nagios'
|
||||||
- name: 'test-ssl.local'
|
- name: 'test-ssl.local'
|
||||||
proto: ['http', 'https']
|
proto: ['http', 'https']
|
||||||
template: '_base'
|
template: '_base'
|
||||||
|
@ -215,13 +220,20 @@
|
||||||
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
|
||||||
|
|
||||||
|
# --------------------------------
|
||||||
|
# Nagios
|
||||||
|
# --------------------------------
|
||||||
- name: -- VERIFY NAGIOS3 PHP --
|
- name: -- VERIFY NAGIOS3 PHP --
|
||||||
command: "curl -u hanx:qwerty -H 'Host: nagios3.local' http://127.0.0.1/side.php"
|
command: "curl -u nagiosadmin:nagios -H 'Host: nagios3.local' http://127.0.0.1/side.php"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: authok.stdout.find('Nagios Core') != -1
|
register: nagios_php
|
||||||
|
failed_when: nagios_php.stdout.find('Nagios Core') == -1
|
||||||
- name: -- VERIFY NAGIOS3 CGI --
|
- name: -- VERIFY NAGIOS3 CGI --
|
||||||
command: "curl -u hanx:qwerty -H 'Host: nagios3.local' http://127.0.0.1/side.php"
|
command: "curl -u nagiosadmin:nagios -H 'Host: nagios3.local' http://127.0.0.1/cgi-bin/nagios3/summary.cgi"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
register: nagios_cgi
|
||||||
|
failed_when: nagios_cgi.stdout.find('Nagios Event Summary') == -1
|
||||||
- name: -- VERIFY SSL --
|
- name: -- VERIFY SSL --
|
||||||
command: "curl --insecure -H 'Host: {{ item }}' https://127.0.0.1/"
|
command: "curl --insecure -H 'Host: {{ item }}' https://127.0.0.1/"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
Loading…
Reference in New Issue