-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.yml
86 lines (73 loc) · 2.11 KB
/
setup.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
- hosts: coviddb
vars_files:
- vars/main.yml
post_tasks:
- user:
name: centos
groups: docker
append: yes
become: true
roles:
- role: geerlingguy.docker
become: true
tasks:
- name: Install unzip
ansible.builtin.package:
name: unzip
state: latest
become: true
- name: Create data directory if it does not exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: '0755'
loop:
- "{{ data_path }}"
- "{{ data_path }}/nginx"
- "{{ data_path }}/nginx/conf.d"
- name: Copy nginx conf
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop:
- { 'src': app.conf, 'dest': "{{ data_path }}/nginx/conf.d" }
- { 'src': nginx.conf, 'dest': "{{ data_path }}/nginx" }
- name: Copy init-letsencrypt
ansible.builtin.template:
src: init-letsencrypt.sh.j2
dest: "{{ service_path }}/init-letsencrypt.sh"
mode: '0755'
- name: get table data
ansible.builtin.get_url:
url: ftp://xfer13.crg.eu/gx-observable.zip
dest: "{{ data_path }}"
- name: unarchive table data
ansible.builtin.unarchive:
src: "{{ data_path }}/gx-observable.zip"
dest: "{{ data_path }}"
remote_src: True
- name: copy init.sql
ansible.builtin.copy:
src: init.sql
dest: "{{ data_path }}/init.sql"
- name: Make sure destination dir exists
ansible.builtin.file:
path: "{{ service_path }}"
state: directory
- name: copy docker-compose.yml
ansible.builtin.copy:
src: docker-compose.yml
dest: "{{ service_path }}"
- name: copy service file
ansible.builtin.template:
src: coviddb.service.j2
dest: "/etc/systemd/system/coviddb.service"
become: true
- name: enable docker-compose service
ansible.builtin.systemd:
name: coviddb.service
enabled: yes
state: restarted
daemon_reload: yes
masked: no
become: true