system-config/playbooks/roles/letsencrypt-create-certs/handlers/restart_apache.yaml
Jeremy Stanley e5ceab1f7d 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
2020-01-14 20:20:43 +00:00

9 lines
166 B
YAML

- name: Populate service facts
service_facts:
- name: Reload apache
service:
name: apache2
state: reloaded
when: "'apache2' in ansible_facts.services"