-
Notifications
You must be signed in to change notification settings - Fork 264
/
node-rm.yml
executable file
·53 lines (51 loc) · 1.93 KB
/
node-rm.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
#!/usr/bin/env ansible-playbook
---
#==============================================================#
# File : node-rm.yml
# Desc : remove node from pigsty
# Ctime : 2022-02-22
# Mtime : 2023-02-20
# Path : node-rm.yml
# Author : Ruohang Feng (rh@vonng.com)
# License : AGPLv3
#==============================================================#
- name: NODE REMOVE
become: yes
hosts: all
gather_facts: no
ignore_errors: yes
roles: [ { role: node_id }, { role: node_remove } ]
#--------------------------------------------------------------#
# Usage
#--------------------------------------------------------------#
#
# Remove node cluster `pg-test`
# node-rm.yml -l pg-test
#
# Remove node instance `10.10.10.11`
# node-rm.yml -l 10.10.10.11
#
#--------------------------------------------------------------#
# Utils
#--------------------------------------------------------------#
#
# bin/node-rm pg-meta # remove nodes of group `pg-meta`
# bin/node-rm pg-meta pg-test # remove multiple node groups
# bin/node-rm 10.10.10.10 # remove node with ip `10.10.10.10`
# bin/node-rm 10.10.10.1* # remove node with pattern `10.10.10.1*`
# bin/node-rm 1.2.3.4 5.6.7.8 # remove multiple nodes
#
#--------------------------------------------------------------#
# Tasks
#--------------------------------------------------------------#
# register : remove register from prometheus & nginx
# - prometheus : remove registered prometheus monitor target
# - nginx : remove nginx proxy record for haproxy admin
# vip : remove node keepalived if enabled
# haproxy : remove haproxy load balancer
# node_exporter : remove monitoring exporter
# vip_exporter : remove keepalived_exporter if enabled
# promtail : remove loki log agent
# profile : remove /etc/profile.d/node.sh
#--------------------------------------------------------------#
...