-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path09_test_flask_app.yml
69 lines (59 loc) · 1.5 KB
/
09_test_flask_app.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
- hosts: all
become: no
gather_facts: False
tasks:
- name: Copy Test Flask app
synchronize:
src: files/Test
dest: /srv
- name: Run setup
command: bash setup
args:
chdir: /srv/Test
- name: Make __pycache__ directory writable by uwsgi
file:
path: /srv/Test/__pycache__
owner: "{{ ansible_user }}"
group: uwsgi
mode: "g+w"
state: directory
become: true
- name: Make data directory writable by uwsgi
file:
path: /srv/Test/data
owner: "{{ ansible_user }}"
group: uwsgi
mode: "g+w"
state: directory
become: true
- name: Check if HTTPS config is already used
stat:
path: /etc/nginx/conf.d/test_nginx_https.conf
register: https_already
- name: Create symlink for nginx
file:
src: /srv/Test/test_nginx.conf
dest: /etc/nginx/conf.d/test_nginx.conf
state: link
become: true
when: https_already.stat.exists == False
notify: Restart nginx
- name: Create symlink for uwsgi
file:
src: /srv/Test/test_uwsgi.ini
dest: /etc/uwsgi.d/test_uwsgi.ini
state: link
become: true
notify: Restart uwsgi
handlers:
- name: Restart nginx
service:
name: nginx
state: restarted
become: true
- name: Restart uwsgi
service:
name: uwsgi
state: restarted
become: true