Fix tests for Debian Stretch
- nagios is not available - curl can use HTTP2 (headers are lowercase) - bypass tests when htpasswd is empty (bypass issue #28)pull/35/head
parent
6935404939
commit
e83395271d
|
@ -1,11 +1,19 @@
|
|||
---
|
||||
|
||||
- name: APT | Install web apps
|
||||
apt: pkg={{ item }} state=present install_recommends=no
|
||||
- name: APT | Install webapps
|
||||
apt:
|
||||
pkg: "{{ item }}"
|
||||
state: present
|
||||
install_recommends: no
|
||||
with_items:
|
||||
- backuppc
|
||||
- nagios3
|
||||
# - owncloud
|
||||
|
||||
- name: APT | Install nagios3 (only on old Debian releases)
|
||||
apt:
|
||||
pkg: nagios3
|
||||
state: present
|
||||
when: ansible_distribution_major_version < 9
|
||||
|
||||
- name: SERVICE | Ensure backuppc is started
|
||||
service: name=backuppc state=started
|
||||
|
|
|
@ -316,6 +316,9 @@
|
|||
# --------------------------------
|
||||
# Basic Auth
|
||||
# --------------------------------
|
||||
|
||||
- block:
|
||||
|
||||
- name: -- VERIFY AUTH BASIC NONE --
|
||||
command: "curl -H 'Host: test-htpasswd.local' http://127.0.0.1/hello/"
|
||||
changed_when: false
|
||||
|
@ -346,6 +349,8 @@
|
|||
register: authgok
|
||||
failed_when: authgok.stdout.find('401 Authorization Required') != -1
|
||||
|
||||
when: nginx_htpasswd | length > 0
|
||||
|
||||
# --------------------------------
|
||||
# BackupPC
|
||||
# --------------------------------
|
||||
|
@ -357,8 +362,10 @@
|
|||
when: ansible_distribution != 'FreeBSD'
|
||||
|
||||
# --------------------------------
|
||||
# Nagios
|
||||
# Nagios (not avaiblable on Debian >= 9)
|
||||
# --------------------------------
|
||||
- block:
|
||||
|
||||
- name: -- VERIFY NAGIOS3 PHP --
|
||||
command: "curl -u nagiosadmin:nagios -H 'Host: nagios3.local' http://127.0.0.1/side.php"
|
||||
changed_when: false
|
||||
|
@ -371,6 +378,8 @@
|
|||
register: nagios_cgi
|
||||
failed_when: nagios_cgi.stdout.find('Nagios Event Summary') == -1
|
||||
|
||||
when: ansible_distribution_major_version < 9
|
||||
|
||||
# --------------------------------
|
||||
# Owncloud
|
||||
# --------------------------------
|
||||
|
@ -425,7 +434,7 @@
|
|||
register: vdefault
|
||||
failed_when: >
|
||||
vdefault.stdout.find('Index HTML test OK') == -1 or
|
||||
vdefault.stderr.find('X-ansible-default') == -1
|
||||
vdefault.stderr.lower().find('x-ansible-default') == -1
|
||||
|
||||
- name: -- VERIFY DEFAULT SSL SITE --
|
||||
command: "curl --insecure -v https://127.0.0.1/"
|
||||
|
@ -433,26 +442,26 @@
|
|||
register: defaultssl
|
||||
failed_when: >
|
||||
defaultssl.stdout.find('Index HTML test OK') == -1 or
|
||||
defaultssl.stderr.find('X-ansible-default') == -1
|
||||
defaultssl.stderr.lower().find('x-ansible-default') == -1
|
||||
|
||||
- name: -- VERIFY NOT DEFAULT SITE --
|
||||
command: "curl -v -H 'Host: test-php.local' http://127.0.0.1/"
|
||||
changed_when: false
|
||||
register: vphp
|
||||
failed_when: vphp.stderr.find('X-ansible-default') != -1
|
||||
failed_when: vphp.stderr.lower().find('x-ansible-default') != -1
|
||||
|
||||
- name: -- VERIFY NOT DEFAULT SSL SITE --
|
||||
command: "curl --insecure -v -H 'Host: test-ssl.local' https://127.0.0.1/"
|
||||
changed_when: false
|
||||
register: notdefaultssl
|
||||
failed_when: notdefaultssl.stderr.find('X-ansible-default') != -1
|
||||
failed_when: notdefaultssl.stderr.lower().find('x-ansible-default') != -1
|
||||
|
||||
- name: -- VERIFY DEFAULT SITE + STUB_STATUS --
|
||||
command: "curl -v http://127.0.0.1/status"
|
||||
changed_when: false
|
||||
register: vdefault_status
|
||||
failed_when: >
|
||||
vdefault_status.stderr.find('X-ansible-default') == -1 or
|
||||
vdefault_status.stderr.lower().find('x-ansible-default') == -1 or
|
||||
vdefault_status.stdout.find('Active connections') == -1
|
||||
|
||||
# --------------------------------
|
||||
|
|
Loading…
Reference in New Issue