-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebserver.yml
executable file
·42 lines (34 loc) · 1.26 KB
/
webserver.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
- hosts: webserver
become: true
tasks:
- name: install web components
apt: name={{item}} state=present update_cache=yes
with_items:
- apache2
- libapache2-mod-wsgi
- python-pip
- python-virtualenv
- name: ensure apache2 started
service: name=apache2 state=started enabled=yes
- name: ensure mod_wsgi enabled
apache2_module: state=present name=wsgi
notify: restart apache2
- name: copy demo app source
copy: src=demo/app/ dest=/var/www/demo mode=0755
notify: restart apache2
- name: copy apache virtual host config
copy: src=demo/demo.conf dest=/etc/apache2/sites-available mode=0755
notify: restart apache2
- name: setup python virtualenv
pip: requirements=/var/www/demo/requirements.txt virtualenv=/var/www/demo/.venv
notify: restart apache2
- name: de-activate default apache site
file: path=/etc/apache2/sites-enabled/000-default.conf state=absent
notify: restart apache2
- name: activate demo apache site
file: src=/etc/apache2/sites-available/demo.conf dest=/etc/apache2/sites-enabled/demo.conf state=link
notify: restart apache2
handlers:
- name: restart apache2
service: name=apache2 state=restarted