Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Stop Apache before making changes
Browse files Browse the repository at this point in the history
  • Loading branch information
David Fernandez committed Jul 8, 2017
1 parent 84eb999 commit 5a1e57b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions ansible/roles/services/apache/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- include: stop.yml
- include: install_apache.yml
- include: install_lets_encrypt.yml
- include: generate_certificate.yml
Expand Down
10 changes: 10 additions & 0 deletions ansible/roles/services/apache/tasks/stop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- name: "Check if service file exists"
stat:
path: "/etc/systemd/system/{{ instance_name }}.service"
register: service_file

- name: "Stop Apache"
service:
name: "{{ instance_name }}.service"
state: stopped
when: service_file.stat.exists

0 comments on commit 5a1e57b

Please sign in to comment.