This repository has been archived by the owner on Jul 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.vagrant.yml
95 lines (87 loc) · 2.88 KB
/
playbook.vagrant.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
- hosts: all
remote_user: ubuntu
vars:
ansible_python_interpreter: /usr/bin/python3
multinet_server_path: "{{ ansible_env.HOME }}/multinet"
multinet_client_path: "{{ ansible_env.HOME }}/multinet/client"
adjmatrix_client_path: "{{ ansible_env.HOME }}/adjmatrix"
adjmatrix_public_path: "adjmatrix"
nodelink_client_path: "{{ ansible_env.HOME }}/nodelink"
nodelink_public_path: "nodelink"
arangodb_password: "letmein"
lockfile_path: /tmp/ansible-playbook.lock
force_ignore_lock: false
sentry_dsn: ""
# Abort if a lockfile is present; otherwise create the file.
pre_tasks:
- stat:
path: "{{lockfile_path}}"
register: lockfile
- fail:
msg: "lockfile found; another ansible process might be running?"
when: lockfile.stat.exists|bool and not force_ignore_lock|bool
- file:
path: "{{lockfile_path}}"
state: absent
become: true
when: "{{force_ignore_lock}}"
- file:
path: "{{lockfile_path}}"
state: touch
become: true
roles:
- role: geerlingguy.nodejs
become: true
- role: oefenweb.yarn
become: true
- role: leesoh.pipenv
become: true
- role: geerlingguy.nginx
vars:
nginx_vhosts:
- listen: "80"
server_name: "_"
state: "present"
filename: "multinet.app.conf"
extra_parameters: |
location /{{nodelink_public_path}} {
alias {{ nodelink_client_path }}/dist;
}
location /{{adjmatrix_public_path}} {
alias {{ adjmatrix_client_path }}/dist;
}
location /api {
include uwsgi_params;
uwsgi_pass unix:{{ multinet_server_path }}/multinet.sock;
}
location /apidocs {
include uwsgi_params;
uwsgi_pass unix:{{ multinet_server_path }}/multinet.sock;
}
location /flasgger_static {
include uwsgi_params;
uwsgi_pass unix:{{ multinet_server_path }}/multinet.sock;
}
location /apispec_1.json {
include uwsgi_params;
uwsgi_pass unix:{{ multinet_server_path }}/multinet.sock;
}
location / {
root {{ multinet_server_path }}/client/dist;
}
nginx_remove_default_vhost: true
become: true
tasks:
- block:
- include_tasks: tasks/arangodb_tasks.yml
- include_tasks: tasks/server_tasks.yml
- include_tasks: tasks/client_tasks.yml
- include_tasks: tasks/nodelink_tasks.yml
- include_tasks: tasks/adjmatrix_tasks.yml
always:
# Remove the lockfile when finished, or on error.
- file:
path: "{{lockfile_path}}"
state: absent
become: true