Browse Source

restart apache on SSL changes

Dan Milon 9 years ago
parent
commit
a419d9403b
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      roles/common/tasks/ssl.yml

+ 7
- 0
roles/common/tasks/ssl.yml View File

1
 - name: Copy SSL private key into place
1
 - name: Copy SSL private key into place
2
   copy: src=wildcard_private.key dest=/etc/ssl/private/wildcard_private.key group=ssl-cert owner=root mode=640
2
   copy: src=wildcard_private.key dest=/etc/ssl/private/wildcard_private.key group=ssl-cert owner=root mode=640
3
   register: private_key
3
   register: private_key
4
+  notify: restart apache
4
 
5
 
5
 - name: Copy SSL public certificate into place
6
 - name: Copy SSL public certificate into place
6
   copy: src=wildcard_public_cert.crt dest=/etc/ssl/certs/wildcard_public_cert.crt group=root owner=root mode=644
7
   copy: src=wildcard_public_cert.crt dest=/etc/ssl/certs/wildcard_public_cert.crt group=root owner=root mode=644
7
   register: certificate
8
   register: certificate
9
+  notify: restart apache
8
 
10
 
9
 - name: Copy CA combined certificate into place
11
 - name: Copy CA combined certificate into place
10
   copy: src=wildcard_ca.pem dest=/etc/ssl/certs/wildcard_ca.pem group=root owner=root mode=644
12
   copy: src=wildcard_ca.pem dest=/etc/ssl/certs/wildcard_ca.pem group=root owner=root mode=644
11
   register: ca_certificate
13
   register: ca_certificate
14
+  notify: restart apache
12
 
15
 
13
 - name: Create a combined version of the public cert with intermediate and root CAs
16
 - name: Create a combined version of the public cert with intermediate and root CAs
14
   shell: cat /etc/ssl/certs/wildcard_public_cert.crt /etc/ssl/certs/wildcard_ca.pem >
17
   shell: cat /etc/ssl/certs/wildcard_public_cert.crt /etc/ssl/certs/wildcard_ca.pem >
17
 
20
 
18
 - name: Set permissions on combined public cert
21
 - name: Set permissions on combined public cert
19
   file: name=/etc/ssl/certs/wildcard_combined.pem mode=644
22
   file: name=/etc/ssl/certs/wildcard_combined.pem mode=644
23
+  notify: restart apache
20
 
24
 
21
 - name: Enable Apache SSL module
25
 - name: Enable Apache SSL module
22
   command: a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.load
26
   command: a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.load
27
+  notify: restart apache
23
 
28
 
24
 - name: Enable NameVirtualHost for HTTPS
29
 - name: Enable NameVirtualHost for HTTPS
25
   lineinfile:
30
   lineinfile:
26
     dest=/etc/apache2/ports.conf regexp='^    NameVirtualHost \*:443'
31
     dest=/etc/apache2/ports.conf regexp='^    NameVirtualHost \*:443'
27
     insertafter='^<IfModule mod_ssl.c>'
32
     insertafter='^<IfModule mod_ssl.c>'
28
     line='    NameVirtualHost *:443'
33
     line='    NameVirtualHost *:443'
34
+  notify: restart apache
29
 
35
 
30
 - name: Add common Apache SSL config
36
 - name: Add common Apache SSL config
31
   template:
37
   template:
33
     dest=/etc/apache2/ssl.conf
39
     dest=/etc/apache2/ssl.conf
34
     owner=root
40
     owner=root
35
     group=root
41
     group=root
42
+  notify: restart apache

Loading…
Cancel
Save