Skip to content

Commit 88fdf4a

Browse files
authored
Update deploy_nginx_apache2.yaml
1 parent 3c44dd8 commit 88fdf4a

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

Ansible/deploy_nginx_apache2.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,25 @@
2626

2727
- name: Copy website files to nginx server
2828
synchronize:
29-
src: /tmp/website/index.html
30-
dest: /usr/share/nginx/html/
29+
src: /tmp/website/
30+
dest: /var/www/html/
3131
when: "'nginx' in inventory_hostname"
32+
notify: Restart Nginx
3233

3334
- name: Copy website files to apache server
3435
synchronize:
35-
src: /tmp/website/index.html
36+
src: /tmp/website/
3637
dest: /var/www/html/
3738
when: "'apache' in inventory_hostname"
39+
notify: Restart Apache
40+
41+
handlers:
42+
- name: Restart Nginx
43+
service:
44+
name: nginx
45+
state: restarted
46+
47+
- name: Restart Apache
48+
service:
49+
name: apache2
50+
state: restarted

0 commit comments

Comments
 (0)