Repository navigation
Expand file tree
/
Copy pathpgsql.yml
More file actions
executable file
·81 lines (69 loc) · 2.35 KB
/
Copy pathpgsql.yml
File metadata and controls
executable file
·81 lines (69 loc) · 2.35 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
#!/usr/bin/env ansible-playbook
---
#==============================================================#
# File : pgsql.yml
# Mtime : 2020-05-12
# Mtime : 2021-07-06
# Desc : init postgres cluster/instance
# Path : pgsql.yml
# Copyright (C) 2018-2021 Ruohang Feng (rh@vonng.com)
#==============================================================#
#==============================================================#
# Playbook : Init PGSQL Cluster/Instance
#==============================================================#
# Init cluster `pg-test`
# pgsql.yml -l pg-test
#
# Init instance (10.10.10.13) among cluster `pg-test`
# pgsql.yml -l 10.10.10.13
#
# Re-init postgres instance only on node 10.10.10.13
# pgsql.yml -l10.10.10.13 --tags=postgres
#
# Re-deploy monitor component
# pgsql.yml --tags=monitor
#
# Replace exporter with new binary version
# pgsql.yml --tags=monitor -e exporter_install=binary
#
# Refresh (haproxy) services
# pgsql.yml --tags=service
#
# Refresh HBA rules
# pgsql.yml --tags=pg_hba
#
# Register cluster/instance to infrastructure
# pgsql.yml --tags=register # register all
# pgsql.yml --tags=register_consul # service discovery
# pgsql.yml --tags=register_prometheus # monitor target
# pgsql.yml --tags=register_grafana # pgsql datasource
# pgsql.yml --tags=register_nginx # haproxy admin page
#==============================================================#
#---------------------------------------------------------------
- name: Infra Init # init infra on common database node
become: yes
hosts: all
gather_facts: no
tags: infra
roles:
- role: node # init common database node
tags: node
- role: consul # init dcs:consul clients
tags: [ dcs , consul ]
#---------------------------------------------------------------
- name: Pgsql Init # init postgres cluster/instance
become: yes
hosts: all
gather_facts: no
tags: pgsql
roles:
- role: postgres # init postgres pgbouncer patroni
tags: postgres
- role: monitor # init monitor exporters
tags: monitor
- role: service # init service , lb , vip
tags: service
- role: register # register cluster/instance to infra
tags: register
#---------------------------------------------------------------
...