-
Notifications
You must be signed in to change notification settings - Fork 1
/
playbook.yaml
144 lines (133 loc) · 3.47 KB
/
playbook.yaml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
- hosts: all
become: yes
vars_files:
- default-ansible-variables.yaml
- ansible-variables.yaml
roles:
- role: vwall2_node
tags: setup
- role: imecilabt.common.be_timezone
tags: setup
- role: imecilabt.common.software
tags: setup
- role: imecilabt.common.fix_annoyances
tags: setup
- role: imecilabt.common.git_known_hosts
tags: setup
- role: fqdn
tags: setup, facts
- role: python
tags: setup, python
- role: perfstat
tags: setup
- role: install_perftest_agent
tags: setup, perftest_agent
- role: nodejs
tags: setup, nodejs
# - role: css_populate
# tags: setup,solidlab_tools
# - role: css_flood
# tags: setup,solidlab_tools
- role: solid_perftest_tools
tags: setup,solidlab_tools
- role: install_perftest_upload
tags: setup,solidlab_tools
when: install_perftest_upload
- hosts: ss_servers
become: yes
vars_files:
- default-ansible-variables.yaml
- ansible-variables.yaml
roles:
- role: docker
when: install_kss
tags: setup
- role: certbot
when: ss_use_https
tags: setup
- role: redis
when: install_css
tags: setup
- role: java
when: install_kss
tags: setup
- role: install_common_ss
tags: ['css', 'kss', 'common_ss']
- role: install_css
when: install_css
tags: css
- role: install_kss
when: install_kss
tags: kss
- role: nginx
when: install_nginx
tags: nginx
tasks:
# - name: Print all available facts
# ansible.builtin.debug:
# var: ansible_facts
# - name: Print hostvars
# ansible.builtin.debug:
# var: hostvars
- name: Check if https is possible
ansible.builtin.fail:
msg: If https is required, the host needs a valid FQDN
when: ( ss_use_https and not has_fqdn )
tags: setup
# - name: Set an ID for the node in /etc/nickname
# ansible.builtin.copy:
# content: test
# dest: /etc/nickname
# Start CSS
- name: Start CSS
shell: setup_css.sh
when: start_css
timeout: "{{ 20 * 60 }}"
environment:
SS_PUBLIC_DNS_NAME: "{{ '' if ss_use_https else 'localhost' }}"
tags: css, start
# setup_css.sh writes to /usr/local/share/ss_url
- name: Start KSS
shell: setup_kss.sh
when: start_kss
timeout: "{{ 20 * 60 }}"
environment:
SS_PUBLIC_DNS_NAME: "{{ '' if ss_use_https else 'localhost' }}"
tags: kss, start
# setup_kss.sh writes to /usr/local/share/ss_url
- name: Collect server URLs
ansible.builtin.fetch:
src: /usr/local/share/ss_url
dest: ss_url_{{ inventory_hostname }}
flat: yes
when: ( start_kss or start_css )
tags: post
- name: Stop CSS
ansible.builtin.systemd:
state: stopped
name: css
when: refresh_css
tags: refresh_css
- name: Flush CSS Redis
shell: /usr/bin/redis-cli flushall
when: refresh_css
tags: refresh_css
- name: Start CSS
ansible.builtin.systemd:
state: started
name: css
when: refresh_css
tags: refresh_css
- hosts: clients
become: yes
vars_files:
- default-ansible-variables.yaml
- ansible-variables.yaml
roles:
- role: install_client_scripts
when: install_client_scripts
tags: install_client_scripts
- role: docker
when: jbr_client
tags: setup,jbr_client