ajout verif status et fonction curl
This commit is contained in:
1
eval.sh
1
eval.sh
@@ -10,3 +10,4 @@ dirMustExist /srv/cours/logs
|
||||
pkgInstalled httpd
|
||||
serviceIsEnabled httpd
|
||||
serviceIsActive httpd
|
||||
okIfCurl http://localhost/config "strong>MPM Name"
|
||||
|
||||
4
eval.yml
4
eval.yml
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- hosts:
|
||||
- b2
|
||||
- all
|
||||
user: root
|
||||
gather_facts: false
|
||||
vars:
|
||||
@@ -10,7 +10,7 @@
|
||||
- name: insert header
|
||||
lineinfile:
|
||||
path: "{{ result_file }}"
|
||||
line: "machine\tuser\tconffile\twebdir\tlogdir\tpkg\tservice enabled\tservice activated"
|
||||
line: "machine\tuser\tconffile\twebdir\tlogdir\tpkg\tservice enabled\tservice activated\tmpmok"
|
||||
state: present
|
||||
create: true
|
||||
delegate_to: localhost
|
||||
|
||||
@@ -161,3 +161,11 @@ function serviceIsActive {
|
||||
if ( systemctl is-active $1 &> /dev/null ) ; then echo -ne "1\t" ; else echo -ne "0\t" ; fi
|
||||
}
|
||||
|
||||
# ok if output of given url contains given stuff
|
||||
# arg1: url
|
||||
# arg2: string
|
||||
function okIfCurl {
|
||||
url=$1
|
||||
shift
|
||||
if ( curl --silent "${url}" | grep -q "$@" ) ; then echo -ne "1\t" ; else echo -ne "0\t" ; fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user