-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.yml
66 lines (56 loc) · 1.8 KB
/
update.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
- name: Update elasticsearch
hosts: elasticsearch_setup:elasticsearch_config
become: true
tasks:
- name: Import general purpose variables
include_vars: "vars/general.json"
- name: Check if the current elasticsearch version is up to date
stat:
path: "{{ root_path }}/{{ elastic_root_path }}/{{ elastic_current_version }}"
register: elastic_exists
- name: Update Elasticsearch version
include_role:
name: elasticsearch_setup
when: not elastic_exists.stat.exists
- name: Update backend
hosts: backend
tasks:
- name: Import general purpose variables
include_vars: "vars/general.json"
- name: Update backend
include_role:
name: update
vars:
project_name: "{{ dbserver_project_name }}"
user_name: "{{ dbserver_user_name }}"
- name: Update frontend
hosts: frontend
become: yes
tasks:
- name: Import general purpose variables
include_vars: "vars/general.json"
- name: Import general purpose variables
include_vars: "vars/general.json"
- name: Update API
include_role:
name: update
vars:
project_name: "{{ webserver_project_name }}"
user_name: "{{ webserver_user_name }}"
- name: "Update static frontend files for the webfrontend and blog"
include_role:
name: setup_static_from_release
vars:
static_project_name: "{{ item }}"
project_path: "{{ root_path }}/{{ webserver_project_name }}"
user_name: "{{ webserver_user_name }}"
user_group: "{{ webserver_user_group }}"
loop:
- "webfrontend"
- "blog"
- name: Restart the webserver
ansible.builtin.service:
name: "OSINT{{ webserver_project_name }}.service"
state: restarted
enabled: yes
become: yes