-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathdocker.yml
More file actions
81 lines (71 loc) · 3.02 KB
/
Copy pathdocker.yml
File metadata and controls
81 lines (71 loc) · 3.02 KB
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
---
- name: "docker.yml: Populate service facts"
service_facts:
- name: "docker.yml: Add custom dockerd config"
copy:
content: "{{ docker_daemon_custom_config }}"
dest: "/etc/docker/daemon.json"
become: true
when: docker_daemon_custom_config is defined
- name: "docker.yml: Set start command"
set_fact:
start_command: |
./start-all.sh \
-d {{ scylla_monitoring_data_path }} \
-f {{ scylla_monitoring_alertdata_path }} \
-v {{ _scylla_monitoring_dashboards_versions|join(',') }} \
-s {{ scylla_monitoring_config_path }}/scylla_servers.yml \
-N {{ scylla_monitoring_config_path }}/scylla_manager_servers.yml \
-r {{ scylla_monitoring_config_path }}/rule_config.yml \
-R {{ scylla_monitoring_prom_rules_path }} \
-b --storage.tsdb.retention.time={{ scylla_monitoring_retention }} \
-c GF_AUTH_BASIC_ENABLED=True \
{{ '-a ' + grafana_admin_password if grafana_admin_password is defined }} \
{{ _scylla_monitoring_params }}
- set_fact:
monitoring_cql_username: "{{ item.split('=')[0] }}"
monitoring_cql_password: "{{ item.split('=')[1] }}"
when: "'cql_credentials' in groups and item.split('=')[0] == scylla_monitoring_cql_default_user | default('scylla_cql_monitor')"
loop: "{{ groups['cql_credentials'] }}"
- name: "docker.yml: Write stop monitoring wrapper script"
template:
src: stop-monitoring.sh.j2
dest: "{{ scylla_monitoring_stop_script_path }}"
mode: '0750'
owner: "{{ ansible_user_id }}"
- name: "docker.yml: Write start monitoring env file"
template:
src: start-monitoring.env.j2
dest: "{{ scylla_monitoring_start_env_path }}"
mode: '0600'
owner: "{{ ansible_user_id }}"
when: monitoring_cql_username is defined and monitoring_cql_password is defined
- name: "docker.yml: Write start monitoring wrapper script"
template:
src: start-monitoring.sh.j2
dest: "{{ scylla_monitoring_start_script_path }}"
mode: '0750'
owner: "{{ ansible_user_id }}"
- name: "docker.yml: restart the docker daemon again"
service:
name: docker
state: restarted
enabled: yes
become: true
when: ansible_facts.services["docker.service"] is defined
- name: "docker.yml: update docker.sock permissions to work around the restart issue"
file:
path: /var/run/docker.sock
owner: root
group: root
mode: '0666'
become: true
when: ansible_facts.services["docker.service"] is defined
- name: "docker.yml: Stop monitoring"
command: "{{ scylla_monitoring_stop_script_path }}"
- name: "docker.yml: start scylla-monitoring"
command: "{{ scylla_monitoring_start_script_path }}"
become: "{{ 'true' if run_docker_with_sudo is defined and run_docker_with_sudo|bool == True else 'false' }}"
environment:
SCYLLA_USER: "{% if monitoring_cql_username is defined and monitoring_cql_password is defined %}{{ monitoring_cql_username }}{% endif %}"
SCYLLA_PSSWD: "{% if monitoring_cql_username is defined and monitoring_cql_password is defined %}{{ monitoring_cql_password }}{% endif %}"