Gracefully restart Apache after cert replacements

Apache doesn't have a reload, but it has something almost as good: a
"graceful" restart. This begins accepting connections while existing
ones wind down, rather than terminating them prematurely. Most
distributions (including the ones we use) map this to the "reload"
action of their SysV initscripts or SystemD service units for
Apache. As a result, we can be nicer to our users by applying the
"reloaded" state to the service module for it in our Ansible role
when Let's Encrypt SSL certs are replaced.

Change-Id: Iac3fad3d0d8216914d94a42f7705e07cef741847
This commit is contained in:
Jeremy Stanley 2020-01-14 20:20:43 +00:00
parent eec87262b2
commit e5ceab1f7d

View File

@ -1,8 +1,8 @@
- name: Populate service facts
service_facts:
- name: Restart apache
- name: Reload apache
service:
name: apache2
state: restarted
state: reloaded
when: "'apache2' in ansible_facts.services"