Setup a proxyreload for httpd that looks for the ticketkey. If it's not there, assume the proxy is just being configured and don't reload httpd.
This commit is contained in:
parent
181c1c7c32
commit
1effd347df
12 changed files with 47 additions and 19 deletions
|
@ -93,6 +93,9 @@
|
||||||
- name: restart postfix
|
- name: restart postfix
|
||||||
service: name=postfix state=restarted
|
service: name=postfix state=restarted
|
||||||
|
|
||||||
|
- name: reload proxyhttpd
|
||||||
|
command: /usr/local/bin/proxy-conditional-reload.sh httpd httpd
|
||||||
|
|
||||||
- name: restart glusterd
|
- name: restart glusterd
|
||||||
service: name=glusterd state=restarted
|
service: name=glusterd state=restarted
|
||||||
|
|
||||||
|
|
25
roles/base/files/common-scripts/proxy-conditional-reload.sh
Normal file
25
roles/base/files/common-scripts/proxy-conditional-reload.sh
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# reload SERVICE only if PACKAGE is installed.
|
||||||
|
# We use this throughout handlers/restart_services.yml
|
||||||
|
|
||||||
|
SERVICE=$1
|
||||||
|
PACKAGE=$2
|
||||||
|
|
||||||
|
rpm -q $PACKAGE
|
||||||
|
|
||||||
|
INSTALLED=$?
|
||||||
|
|
||||||
|
if [ ! -f /etc/httpd/ticketkey_*.tkey ]; then
|
||||||
|
# This host is not configured yet, do not try and restart httpd
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $INSTALLED -eq 0 ]; then
|
||||||
|
echo "Package $PACKAGE installed. Attempting reload of $SERVICE."
|
||||||
|
/sbin/service $SERVICE reload
|
||||||
|
exit $? # Exit with the /sbin/service status code
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If the package wasn't installed, then pretend everything is fine.
|
||||||
|
echo "Package $PACKAGE not installed. Skipping reload of $SERVICE."
|
||||||
|
exit 0
|
|
@ -13,7 +13,7 @@
|
||||||
mode=0644
|
mode=0644
|
||||||
when: SSLCertificateChainFile is defined
|
when: SSLCertificateChainFile is defined
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/certificate
|
- httpd/certificate
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
- "{{private}}/files/httpd/{{cert}}.cert"
|
- "{{private}}/files/httpd/{{cert}}.cert"
|
||||||
- "{{private}}/files/httpd/{{name}}.cert"
|
- "{{private}}/files/httpd/{{name}}.cert"
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/certificate
|
- httpd/certificate
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
- "{{private}}/files/httpd/{{key}}.key"
|
- "{{private}}/files/httpd/{{key}}.key"
|
||||||
- "{{private}}/files/httpd/{{name}}.key"
|
- "{{private}}/files/httpd/{{name}}.key"
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/certificate
|
- httpd/certificate
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
- "{{roles}}/httpd/domainrewrite/templates/domainrewrite.{{destname}}.conf"
|
- "{{roles}}/httpd/domainrewrite/templates/domainrewrite.{{destname}}.conf"
|
||||||
- "{{roles}}/httpd/domainrewrite/templates/domainrewrite.conf"
|
- "{{roles}}/httpd/domainrewrite/templates/domainrewrite.conf"
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/domainrewrite
|
- httpd/domainrewrite
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- copy: src=fingerprints.html dest=/srv/web/fingerprints.html
|
- copy: src=fingerprints.html dest=/srv/web/fingerprints.html
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- fingerprints
|
- fingerprints
|
||||||
- httpd
|
- httpd
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
- copy: src=fingerprints.conf dest=/etc/httpd/conf.d/{{website}}/fingerprints.conf
|
- copy: src=fingerprints.conf dest=/etc/httpd/conf.d/{{website}}/fingerprints.conf
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- fingerprints
|
- fingerprints
|
||||||
- httpd
|
- httpd
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
src=mime-types.conf dest=/etc/httpd/conf.d/{{website}}/mime-types.conf
|
src=mime-types.conf dest=/etc/httpd/conf.d/{{website}}/mime-types.conf
|
||||||
owner=root group=root mode=0644
|
owner=root group=root mode=0644
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/mime-type
|
- httpd/mime-type
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
- name: Install mod_ssl
|
- name: Install mod_ssl
|
||||||
yum: name=mod_ssl state=installed
|
yum: name=mod_ssl state=installed
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/mod_ssl
|
- httpd/mod_ssl
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
group=root
|
group=root
|
||||||
mode=0644
|
mode=0644
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/certificate
|
- httpd/certificate
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
src=httpd.conf.j2 dest=/etc/httpd/conf/httpd.conf
|
src=httpd.conf.j2 dest=/etc/httpd/conf/httpd.conf
|
||||||
owner=root group=root mode=0644
|
owner=root group=root mode=0644
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/proxy
|
- httpd/proxy
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
- 02-ticketkey.conf
|
- 02-ticketkey.conf
|
||||||
- 03-reqtimeout.conf
|
- 03-reqtimeout.conf
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/proxy
|
- httpd/proxy
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
- name: set the apache mpm to use event MPM
|
- name: set the apache mpm to use event MPM
|
||||||
copy: src=00-mpm.conf dest=/etc/httpd/conf.modules.d/00-mpm.conf
|
copy: src=00-mpm.conf dest=/etc/httpd/conf.modules.d/00-mpm.conf
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/proxy
|
- httpd/proxy
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
owner=root
|
owner=root
|
||||||
group=root
|
group=root
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- redirect.{{name}}.conf
|
- redirect.{{name}}.conf
|
||||||
- redirect.conf
|
- redirect.conf
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
owner=root
|
owner=root
|
||||||
group=root
|
group=root
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/redirect
|
- httpd/redirect
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
- "{{roles}}/httpd/reverseproxy/templates/reversepassproxy.{{destname}}.conf"
|
- "{{roles}}/httpd/reverseproxy/templates/reversepassproxy.{{destname}}.conf"
|
||||||
- "{{roles}}/httpd/reverseproxy/templates/reversepassproxy.conf"
|
- "{{roles}}/httpd/reverseproxy/templates/reversepassproxy.conf"
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/reverseproxy
|
- httpd/reverseproxy
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
group=root
|
group=root
|
||||||
mode=0755
|
mode=0755
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/website
|
- httpd/website
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
group=root
|
group=root
|
||||||
mode=0644
|
mode=0644
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/website
|
- httpd/website
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
- logs
|
- logs
|
||||||
- robots
|
- robots
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/website
|
- httpd/website
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
- robots/robots.txt.{{name}}
|
- robots/robots.txt.{{name}}
|
||||||
- robots/robots.txt
|
- robots/robots.txt
|
||||||
notify:
|
notify:
|
||||||
- reload httpd
|
- reload proxyhttpd
|
||||||
tags:
|
tags:
|
||||||
- httpd
|
- httpd
|
||||||
- httpd/website
|
- httpd/website
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue