-
Notifications
You must be signed in to change notification settings - Fork 266
/
slim.yml
executable file
·92 lines (82 loc) · 2.89 KB
/
slim.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
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env ansible-playbook
---
#==============================================================#
# File : slim.yml
# Desc : slim install minimal version of pigsty (no infra)
# Ctime : 2024-09-02
# Mtime : 2024-11-24
# Path : pgsql-min.yml
# License : AGPLv3 @ https://pigsty.io/docs/about/license
# Copyright : 2018-2024 Ruohang Feng / Vonng ([email protected])
#==============================================================#
# The slim installation focus on Pure HA-PostgreSQL Cluster
# It only install essential components for this purpose
#
# There's NO Infra modules, No monitoring, No software repo
# Just partial of NODE module, along with ETCD & PGSQL modules
#
# Systemd Service Installed in this mode:
#
# patroni, pgbouncer, vip-manager, haproxy, etcd, chronyd, tuned
#---------------------------------------------------------------
# setup node & pgsql identity
#---------------------------------------------------------------
- name: IDENTITY
hosts: all
gather_facts: no
tags: id
roles:
- { role: node_id ,tags: node-id }
- { role: pg_id ,tags: pg-id ,when: pg_cluster is defined }
#---------------------------------------------------------------
# Setup local CA
#---------------------------------------------------------------
- name: CA
become: yes
hosts: localhost
gather_facts: no
tags: ca
roles: [ { role: ca } ]
#---------------------------------------------------------------
# init node , ca, docker
#---------------------------------------------------------------
- name: NODE INIT
become: yes
hosts: all
gather_facts: no
tags: node
roles:
- { role: node , tags: node } # prepare node for pigsty
- { role: haproxy , tags: haproxy } # init haproxy optional
#---------------------------------------------------------------
# init infra cert
#---------------------------------------------------------------
- name: INFRA INIT
become: yes
hosts: infra
gather_facts: no
tags: infra
tasks:
- group: name=infra
- user: name={% if node_user == 'root' %}{{ node_admin_username }}{% else %}{{ node_user }}{% endif %} append=true groups=infra
- user: name={{ node_admin_username|default('dba') }} append=true groups=infra
- include_tasks: roles/infra/tasks/cert.yml
#---------------------------------------------------------------
# ETCD INIT
#---------------------------------------------------------------
- name: ETCD INIT
become: yes
hosts: etcd
gather_facts: no
tags: etcd
roles: [ { role: etcd } ] # init etcd on fixed group 'etcd'
#---------------------------------------------------------------
# INIT PGSQL
#---------------------------------------------------------------
- name: PGSQL INIT # init pgsql on all nodes
become: yes # with pg_cluster defined
hosts: all
gather_facts: no
tags: pgsql
roles: [ { role: pgsql ,when: pg_cluster is defined } ]
...