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:
Kevin Fenzi 2016-12-01 21:36:07 +00:00
parent 181c1c7c32
commit 1effd347df
12 changed files with 47 additions and 19 deletions

View file

@ -93,6 +93,9 @@
- name: restart postfix
service: name=postfix state=restarted
- name: reload proxyhttpd
command: /usr/local/bin/proxy-conditional-reload.sh httpd httpd
- name: restart glusterd
service: name=glusterd state=restarted

View 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

View file

@ -13,7 +13,7 @@
mode=0644
when: SSLCertificateChainFile is defined
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/certificate
@ -29,7 +29,7 @@
- "{{private}}/files/httpd/{{cert}}.cert"
- "{{private}}/files/httpd/{{name}}.cert"
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/certificate
@ -45,7 +45,7 @@
- "{{private}}/files/httpd/{{key}}.key"
- "{{private}}/files/httpd/{{name}}.key"
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/certificate

View file

@ -16,7 +16,7 @@
- "{{roles}}/httpd/domainrewrite/templates/domainrewrite.{{destname}}.conf"
- "{{roles}}/httpd/domainrewrite/templates/domainrewrite.conf"
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/domainrewrite

View file

@ -1,6 +1,6 @@
- copy: src=fingerprints.html dest=/srv/web/fingerprints.html
notify:
- reload httpd
- reload proxyhttpd
tags:
- fingerprints
- httpd
@ -8,7 +8,7 @@
- copy: src=fingerprints.conf dest=/etc/httpd/conf.d/{{website}}/fingerprints.conf
notify:
- reload httpd
- reload proxyhttpd
tags:
- fingerprints
- httpd

View file

@ -2,7 +2,7 @@
src=mime-types.conf dest=/etc/httpd/conf.d/{{website}}/mime-types.conf
owner=root group=root mode=0644
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/mime-type

View file

@ -1,7 +1,7 @@
- name: Install mod_ssl
yum: name=mod_ssl state=installed
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/mod_ssl
@ -14,7 +14,7 @@
group=root
mode=0644
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/certificate

View file

@ -3,7 +3,7 @@
src=httpd.conf.j2 dest=/etc/httpd/conf/httpd.conf
owner=root group=root mode=0644
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/proxy
@ -27,7 +27,7 @@
- 02-ticketkey.conf
- 03-reqtimeout.conf
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/proxy
@ -35,7 +35,7 @@
- name: set the apache mpm to use event MPM
copy: src=00-mpm.conf dest=/etc/httpd/conf.modules.d/00-mpm.conf
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/proxy

View file

@ -14,7 +14,7 @@
owner=root
group=root
notify:
- reload httpd
- reload proxyhttpd
with_first_found:
- redirect.{{name}}.conf
- redirect.conf

View file

@ -14,7 +14,7 @@
owner=root
group=root
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/redirect

View file

@ -17,7 +17,7 @@
- "{{roles}}/httpd/reverseproxy/templates/reversepassproxy.{{destname}}.conf"
- "{{roles}}/httpd/reverseproxy/templates/reversepassproxy.conf"
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/reverseproxy

View file

@ -16,7 +16,7 @@
group=root
mode=0755
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/website
@ -31,7 +31,7 @@
group=root
mode=0644
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/website
@ -47,7 +47,7 @@
- logs
- robots
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/website
@ -64,7 +64,7 @@
- robots/robots.txt.{{name}}
- robots/robots.txt
notify:
- reload httpd
- reload proxyhttpd
tags:
- httpd
- httpd/website