Merge branch 'server-status-suffix' into unstable
This commit is contained in:
commit
316fabeabe
|
@ -12,6 +12,7 @@ apache_evolinux_default_ssl_cert: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
|||
apache_evolinux_default_ssl_key: /etc/ssl/private/ssl-cert-snakeoil.key
|
||||
|
||||
apache_serverstatus_suffix: ""
|
||||
apache_serverstatus_suffix_file: "/etc/evolinux/apache_serverstatus_suffix"
|
||||
|
||||
apache_log2mail_include: True
|
||||
apache_munin_include: True
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
apt:
|
||||
name: log2mail
|
||||
state: present
|
||||
tags:
|
||||
- apache
|
||||
|
||||
- name: Add log2mail config for Apache segfaults
|
||||
template:
|
||||
|
@ -13,3 +15,5 @@
|
|||
group: adm
|
||||
mode: "0644"
|
||||
force: no
|
||||
tags:
|
||||
- apache
|
||||
|
|
|
@ -46,6 +46,10 @@
|
|||
tags:
|
||||
- apache
|
||||
|
||||
- include: server_status.yml
|
||||
tags:
|
||||
- apache
|
||||
|
||||
- name: Copy Apache defaults config file
|
||||
copy:
|
||||
src: evolinux-defaults.conf
|
||||
|
@ -75,6 +79,8 @@
|
|||
dest: /etc/apache2/mods-enabled/status.conf
|
||||
state: absent
|
||||
notify: reload apache
|
||||
tags:
|
||||
- apache
|
||||
|
||||
- name: Ensure Apache config files are enabled
|
||||
command: "a2enconf {{ item }}"
|
||||
|
@ -88,6 +94,8 @@
|
|||
- apache
|
||||
|
||||
- include: auth.yml
|
||||
tags:
|
||||
- apache
|
||||
|
||||
- name: default vhost is installed
|
||||
template:
|
||||
|
@ -142,9 +150,15 @@
|
|||
dest: /usr/share/scripts/save_apache_status.sh
|
||||
mode: "0755"
|
||||
force: no
|
||||
tags:
|
||||
- apache
|
||||
|
||||
- include: log2mail.yml
|
||||
when: apache_log2mail_include
|
||||
tags:
|
||||
- apache
|
||||
|
||||
- include: munin.yml
|
||||
when: apache_munin_include
|
||||
tags:
|
||||
- apache
|
||||
|
|
29
apache/tasks/server_status.yml
Normal file
29
apache/tasks/server_status.yml
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
|
||||
- name: set apache serverstatus suffix if provided
|
||||
shell: "echo {{ apache_serverstatus_suffix }} > {{ apache_serverstatus_suffix_file }}"
|
||||
when: apache_serverstatus_suffix != ""
|
||||
|
||||
- name: generate random string for server-status suffix
|
||||
shell: "apg -a 1 -M N -n 1 > {{ apache_serverstatus_suffix_file }}"
|
||||
args:
|
||||
creates: "{{ apache_serverstatus_suffix_file }}"
|
||||
|
||||
- name: read apache server status suffix
|
||||
command: "tail -n 1 {{ apache_serverstatus_suffix_file }}"
|
||||
changed_when: False
|
||||
check_mode: no
|
||||
register: new_apache_serverstatus_suffix
|
||||
|
||||
- name: overwrite apache_serverstatus_suffix
|
||||
set_fact:
|
||||
apache_serverstatus_suffix: "{{ new_apache_serverstatus_suffix.stdout }}"
|
||||
|
||||
- debug:
|
||||
var: apache_serverstatus_suffix
|
||||
|
||||
- name: replace server-status suffix in default site index
|
||||
replace:
|
||||
dest: /var/www/index.html
|
||||
regexp: '__SERVERSTATUS_SUFFIX__'
|
||||
replace: "{{ apache_serverstatus_suffix }}"
|
|
@ -53,7 +53,7 @@
|
|||
</Location>
|
||||
|
||||
<IfModule mod_status.c>
|
||||
<Location /server-status>
|
||||
<Location /server-status-{{ apache_serverstatus_suffix | mandatory }}>
|
||||
SetHandler server-status
|
||||
include /etc/apache2/ipaddr_whitelist.conf
|
||||
Require local
|
||||
|
@ -112,7 +112,7 @@
|
|||
LogLevel warn
|
||||
|
||||
<IfModule mod_status.c>
|
||||
<Location /server-status>
|
||||
<Location /server-status-{{ apache_serverstatus_suffix | mandatory }}>
|
||||
SetHandler server-status
|
||||
include /etc/apache2/ipaddr_whitelist.conf
|
||||
Require local
|
||||
|
|
|
@ -21,6 +21,10 @@ evolinux_apt_public_sources: True
|
|||
evolinux_apt_upgrade: True
|
||||
evolinux_apt_remove_aptitude: True
|
||||
|
||||
# etc-evolinux
|
||||
|
||||
evolinux_etcevolinux_include: True
|
||||
|
||||
# etc-git
|
||||
|
||||
evolinux_etcgit_include: True
|
||||
|
|
9
evolinux-base/tasks/etc-evolinux.yml
Normal file
9
evolinux-base/tasks/etc-evolinux.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
- name: /etc/evolinux exists
|
||||
file:
|
||||
dest: /etc/evolinux
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0700"
|
||||
state: directory
|
|
@ -19,6 +19,10 @@
|
|||
name: etc-git
|
||||
when: evolinux_etcgit_include
|
||||
|
||||
- name: /etc/evolinux base
|
||||
include: etc-evolinux.yml
|
||||
when: evolinux_etcevolinux_include
|
||||
|
||||
- name: Hostname
|
||||
include: hostname.yml
|
||||
when: evolinux_hostname_include
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
<ul id="evolinks">
|
||||
<li><a href="/munin/{{ ansible_domain }}/{{ ansible_fqdn }}/">Stats système</a></li>
|
||||
<li><a href="/server-status">Server Status</a></li>
|
||||
<li><a href="/server-status-__SERVERSTATUS_SUFFIX__">Server Status</a></li>
|
||||
<!-- <li><a href="/phpmyadmin-__PHPMYADMIN_SUFFIX__/">Accès PhpMyAdmin</a></li> -->
|
||||
<!-- <li><a href="/mysqlreport.html">Dernier rapport MySQL Tuner</a></li> -->
|
||||
<!-- <li><a href="/cgi-bin/awstats.pl">Stats web</a></li> -->
|
||||
|
|
|
@ -16,4 +16,6 @@ nginx_default_redirect_url: "http://evolix.fr"
|
|||
nginx_evolinux_default_enabled: True
|
||||
|
||||
# nginx_phpmyadmin_suffix: ""
|
||||
# nginx_serverstatus_suffix: ""
|
||||
|
||||
nginx_serverstatus_suffix: ""
|
||||
nginx_serverstatus_suffix_file: "/etc/evolinux/nginx_serverstatus_suffix"
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
---
|
||||
|
||||
- name: logrotate configuration
|
||||
copy:
|
||||
src: logrotate_nginx
|
||||
dest: /etc/logrotate.d/nginx
|
||||
force: no
|
||||
tags:
|
||||
- nginx
|
||||
- logrotate
|
||||
|
|
|
@ -107,6 +107,10 @@
|
|||
tags:
|
||||
- nginx
|
||||
|
||||
- include: server_status.yml
|
||||
tags:
|
||||
- nginx
|
||||
|
||||
- name: nginx vhost is installed
|
||||
template:
|
||||
src: evolinux-default.conf.j2
|
||||
|
|
29
nginx/tasks/server_status.yml
Normal file
29
nginx/tasks/server_status.yml
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
|
||||
- name: set nginx serverstatus suffix if provided
|
||||
shell: "echo {{ nginx_serverstatus_suffix }} > {{ nginx_serverstatus_suffix_file }}"
|
||||
when: nginx_serverstatus_suffix != ""
|
||||
|
||||
- name: generate random string for server-status suffix
|
||||
shell: "apg -a 1 -M N -n 1 > {{ nginx_serverstatus_suffix_file }}"
|
||||
args:
|
||||
creates: "{{ nginx_serverstatus_suffix_file }}"
|
||||
|
||||
- name: read nginx server status suffix
|
||||
command: "tail -n 1 {{ nginx_serverstatus_suffix_file }}"
|
||||
changed_when: False
|
||||
check_mode: no
|
||||
register: new_nginx_serverstatus_suffix
|
||||
|
||||
- name: overwrite nginx_serverstatus_suffix
|
||||
set_fact:
|
||||
nginx_serverstatus_suffix: "{{ new_nginx_serverstatus_suffix.stdout }}"
|
||||
|
||||
- debug:
|
||||
var: nginx_serverstatus_suffix
|
||||
|
||||
- name: replace server-status suffix in default site index
|
||||
replace:
|
||||
dest: /var/www/index.html
|
||||
regexp: '__SERVERSTATUS_SUFFIX__'
|
||||
replace: "{{ nginx_serverstatus_suffix }}"
|
|
@ -48,7 +48,7 @@ server {
|
|||
listen 80;
|
||||
server_name munin;
|
||||
|
||||
location /nginx_status {
|
||||
location /nginx_status-{{ nginx_serverstatus_suffix | mandatory }} {
|
||||
stub_status on;
|
||||
access_log off;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue