-
Notifications
You must be signed in to change notification settings - Fork 51
/
main.yml
171 lines (145 loc) · 4.01 KB
/
main.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
os: ""
pg_type: PG
pg_version: 14
pg_ssl: true
pg_instance_name: main
pg_remote_ssl_src: false
disable_logging: true
use_hostname: true
update_etc_file: true
use_replication_slots: true
pass_dir: "~/.edb"
pg_wal: ""
pg_local_wal_archive_dir: ""
pg_data: "/var/lib/pgsql/{{ pg_version }}/data"
pg_default_data: "/var/lib/pgsql/{{ pg_version }}/data"
edb_audit_directory: ""
pg_encoding: ""
# log directory and filename
pg_log: "/var/log/postgres"
pg_log_filename: "postgresql-%a.log"
# postgres service
pg_service: "postgresql-{{ pg_version }}-patroni"
# required & optional directories
pg_user_home: "/var/lib/pgsql"
pg_bin_path: "/usr/pgsql-{{ pg_version }}/bin"
pgpass_file: "{{ pg_user_home }}/.pgpass"
patroni_initdb_options:
- "data-checksum"
- "encoding: UTF-8"
- "locale: {{ 'en_US.UTF-8' if ansible_os_family == 'RedHat' else 'C.UTF-8' }}"
- "auth: ident"
- "auth-host: scram-sha-256"
- "auth-local: peer"
pg_basebackup: "{{ pg_bin_path }}/pg_basebackup -Fp -R -l standby --checkpoint=fast --wal-method=stream"
pg_basebackup_options: ""
# setting validate_only to true allows you to validate setup on an existing node
# use_validation flag applies to deployment configuration and validation after setup
validate_only: false
use_validation: true
# unix socket domain directories
pg_unix_socket_directories:
- "/var/run/postgresql"
# ETCD ssl
etcd_ssl: true
etcd_ca_crt: "{{ etcd_ssl_dir }}/ca-crt.pem"
etcd_member_key: "{{ etcd_ssl_dir }}/etcd-key-{{ inventory_hostname }}.pem"
etcd_member_crt: "{{ etcd_ssl_dir }}/etcd-crt-{{ inventory_hostname }}.pem"
# initial configuration for starting postgres
# example:
# pg_init_conf_params:
# - name: "edb_filter_log.redact_password_commands"
# value: "true"
pg_init_conf_params: []
# postgres port
pg_port: 5432
# certain parameters must be placed in the DCS parameters for patroni to recognize
# it will overide any values in postgresql.conf and postgresql.auto.conf for the following parameters:
# - max_wal_senders: 5
# - max_replication_slots: 5
# - wal_keep_segments: 8
# - wal_keep_size: '128MB'
# to override these values, place parameters and value in patroni_pg_init_params
# parameters to be configured in postgresql params in patroni DCS config file
# will be placed:
# postgresql:
# parameters:
# - wal_keep_segments: '32'
# ----- example:
# patroni_pg_init_params:
# - name: 'wal_keep_segments'
# value: '32'
patroni_pg_init_params: ""
# postgres database
pg_database: "postgres"
# postgres user
pg_owner: "postgres"
pg_group: "postgres"
# postgres superuser
pg_superuser: "postgres"
pg_superuser_password: ""
pg_random_password: true
pg_replication_user: "repuser"
pg_replication_user_password: ""
pg_rewind_user: "rewind"
pg_rewind_user_password: ""
synchronous_standby_names: ""
standby_quorum_type: "any"
pg_allow_ip_addresses: []
# Local path to SSL server key and certificate to be sent to the server
# if empty, they are generated
pg_ssl_key_file: ""
pg_ssl_cert_file: ""
pg_ssl_ca_file: ""
pg_ssl_crl_file: ""
# Input variables
input_user: ""
input_password: ""
upstream_public_ip: ""
upstream_hostname: ""
etc_hosts_lists: []
# etcd related parameters
etcd_version: "3.5.7"
etcd_service: "etcd-{{ etcd_version }}"
etcd_client_port: 2379
etcd_bin_dir: "/usr/bin"
# Patroni and etcd variables
patroni_exec_start_pre: ""
patroni_rest_api_port: 8008
patroni_rest_api_listen_addrr: "0.0.0.0"
patroni_rest_api_connect_addrr: "{{ hostvars[inventory_hostname].private_ip }}:{{ patroni_rest_api_port }}"
patroni_log_dir: "/var/log/patroni"
use_patroni: true
patroni_pip_install: true
patroni_package_install: false
patroni_config_dir: "/etc/patroni"
patroni_config_file: "{{ patroni_config_dir }}/{{ inventory_hostname }}.yml"
patroni_pip_packages:
- patroni
- python-etcd
- patroni[dependencies]
- psycopg2
- idna
supported_os:
- CentOS7
- CentOS8
- RedHat7
- RedHat8
- Ubuntu20
- Ubuntu22
- Debian9
- Debian10
- Rocky8
- AlmaLinux8
- OracleLinux7
supported_pg_type:
- EPAS
- PG
supported_pg_version:
- 10
- 11
- 12
- 13
- 14
- 15