-
Notifications
You must be signed in to change notification settings - Fork 5
/
stop.yml
82 lines (69 loc) · 2.16 KB
/
stop.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
- name: check config locally
hosts: localhost
any_errors_fatal: true
tags:
- always
roles:
- check_config
- name: check system environment
hosts: all
any_errors_fatal: true
tags:
- always
roles:
- check_system
- hosts: all
tags:
- node_exporter
tasks:
- name: stop node_exporter by systemd
become: true
systemd: name=node_exporter-{{ node_exporter_port }}.service state=stopped enabled=no
- name: wait for node_exporter up
wait_for: |
host={{ansible_default_ipv4.address}} port={{ node_exporter_port }} state=stopped timeout=30
- hosts: mysql
tags:
- mysql
- mysqld_exporter
sudo: yes
tasks:
- name: stop mysql by mysql.server
become: true
shell: /bin/bash {{ deploy_dir }}/bin/mysql.server stop
- name: wait for mysql up
wait_for: |
host={{ansible_default_ipv4.address}} port={{mysql_port}} state=stopped timeout=30
- name: stop mysqld_exporter
become: true
systemd: name=mysqld_exporter-{{ mysqld_exporter_port }}.service state=stopped enabled=no
- name: wait for mysqld_exporter up
wait_for: |
host={{ansible_default_ipv4.address}} port={{ mysqld_exporter_port }} state=stopped timeout=30
- hosts: radon
tags:
- radon
tasks:
- name: stop radon by systemd
become: true
systemd: name=radon-{{ endpoint }}.service state=stopped enabled=no
- name: wait for radon up
wait_for: |
host={{ansible_default_ipv4.address}} port={{ endpoint }} state=stopped timeout=30
- hosts: monitor
tags:
- prometheus
- grafana
tasks:
- name: stop prometheus by systemd
become: true
systemd: name=prometheus-{{ prometheus_port }}.service state=stopped enabled=no
- name: wait for prometheus up
wait_for: |
host={{ansible_default_ipv4.address}} port={{ prometheus_port }} state=stopped timeout=30
- name: stop grafana by systemd
become: true
systemd: name=grafana-{{ grafana_port }}.service state=stopped enabled=no
- name: wait for grafana up
wait_for: |
host={{ansible_default_ipv4.address}} port={{ grafana_port }} state=stopped timeout=30