-
-
Notifications
You must be signed in to change notification settings - Fork 428
/
system.yml
246 lines (214 loc) · 8.71 KB
/
system.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
---
# DNS servers (/etc/resolv.conf)
nameservers: []
# - "8.8.8.8" # example (Google Public DNS)
# - "9.9.9.9" # (Quad9 Public DNS)
# /etc/hosts (optional)
etc_hosts: []
# - "10.128.64.143 pgbackrest.minio.local minio.local s3.eu-west-3.amazonaws.com" # example (MinIO)
# - ""
ntp_enabled: false # or 'true' if you want to install and configure the ntp service
ntp_servers: []
# - "10.128.64.44"
# - "10.128.64.45"
timezone: ""
# timezone: "Etc/UTC"
# timezone: "America/New_York"
# timezone: "Europe/Moscow"
# timezone: "Europe/Berlin"
# Generate locale
# (except RHEL>=8,use glibc-langpack)
locale_gen:
- { language_country: "en_US", encoding: "UTF-8" }
# - { language_country: "ru_RU", encoding: "UTF-8" }
# - { language_country: "de_DE", encoding: "UTF-8" }
# - { language_country: "", encoding: "" }
# Set system locale (LANG,LC_ALL)
locale: "en_US.utf-8"
# Configure swap space (if not already exists)
swap_file_create: true # or 'false'
swap_file_path: /swapfile
swap_file_size_mb: '4096' # change this value for your system
# Kernel parameters
sysctl_set: true # or 'false'
# these parameters for example! Specify kernel options for your system
sysctl_conf:
etcd_cluster: []
consul_instances: []
master: []
replica: []
pgbackrest: []
postgres_cluster:
- { name: "vm.overcommit_memory", value: "2" }
- { name: "vm.swappiness", value: "1" }
- { name: "vm.min_free_kbytes", value: "102400" }
- { name: "vm.dirty_expire_centisecs", value: "1000" }
- { name: "vm.dirty_background_bytes", value: "67108864" }
- { name: "vm.dirty_bytes", value: "536870912" }
# - { name: "vm.nr_hugepages", value: "9510" } # example "9510"=18GB
- { name: "vm.zone_reclaim_mode", value: "0" }
- { name: "kernel.numa_balancing", value: "0" }
- { name: "kernel.sched_autogroup_enabled", value: "0" }
- { name: "net.ipv4.ip_nonlocal_bind", value: "1" }
- { name: "net.ipv4.ip_forward", value: "1" }
- { name: "net.ipv4.ip_local_port_range", value: "10000 65535" }
- { name: "net.core.netdev_max_backlog", value: "10000" }
- { name: "net.ipv4.tcp_max_syn_backlog", value: "8192" }
- { name: "net.core.somaxconn", value: "65535" }
- { name: "net.ipv4.tcp_tw_reuse", value: "1" }
# - { name: "net.netfilter.nf_conntrack_max", value: "1048576" }
# - { name: "kernel.sched_migration_cost_ns", value: "5000000" }
# - { name: "", value: "" }
balancers:
- { name: "net.ipv4.ip_nonlocal_bind", value: "1" }
- { name: "net.ipv4.ip_forward", value: "1" }
- { name: "net.ipv4.ip_local_port_range", value: "10000 65535" }
- { name: "net.core.netdev_max_backlog", value: "10000" }
- { name: "net.ipv4.tcp_max_syn_backlog", value: "8192" }
- { name: "net.core.somaxconn", value: "65535" }
- { name: "net.ipv4.tcp_tw_reuse", value: "1" }
# - { name: "net.netfilter.nf_conntrack_max", value: "1048576" }
# - { name: "", value: "" }
# Huge Pages
# this setting will automatically configure "vm.nr_hugepages" for shared_buffers of 8GB or more
# if 'sysctl_set' is 'true', "vm.nr_hugepages" is undefined or insufficient in sysctl_conf,
# and "huge_pages" is not 'off' in postgresql_parameters.
huge_pages_auto_conf: true
# Transparent Huge Pages
disable_thp: true # or 'false'
# Max open file limit
set_limits: true # or 'false'
limits_user: "postgres"
soft_nofile: 65536
hard_nofile: 200000
# I/O Scheduler (optional)
set_scheduler: false # or 'true'
scheduler:
- { sched: "deadline", nr_requests: "1024", device: "sda" }
# - { sched: "noop" , nr_requests: "1024", device: "sdb" }
# - { sched: "" , nr_requests: "1024", device: "" }
# Non-multiqueue I/O schedulers:
# cfq - for desktop systems and slow SATA drives
# deadline - for SAS drives (recommended for databases)
# noop - for SSD drives
# Multiqueue I/O schedulers (blk-mq):
# mq-deadline - (recommended for databases)
# none - (ideal for fast random I/O devices such as NVMe)
# bfq - (avoid for databases)
# kyber
# SSH Keys (optional)
enable_ssh_key_based_authentication: false # or 'true' for configure SSH Key-Based Authentication
ssh_key_user: "postgres"
ssh_key_state: "present"
ssh_known_hosts: "{{ groups['postgres_cluster'] }}"
# List of public SSH keys. These keys will be added to the database server's ~/.ssh/authorized_keys file.
ssh_public_keys: []
# sudo
sudo_users:
- name: "postgres"
nopasswd: "yes" # or "no" to require a password
commands: "ALL"
# - name: "joe" # other user (example)
# nopasswd: "no"
# commands: "/usr/bin/find, /usr/bin/less, /usr/bin/tail, /bin/kill"
# Firewall
firewall_enabled_at_boot: false # or 'true' for configure firewall (iptables)
firewall_allowed_tcp_ports_for:
master: []
replica: []
pgbackrest: []
postgres_cluster:
- "{{ ansible_ssh_port | default(22) }}"
- "{{ postgresql_port }}"
- "{{ pgbouncer_listen_port }}"
- "{{ patroni_restapi_port }}"
- "19999" # Netdata
# - "10050" # Zabbix agent
# - ""
etcd_cluster:
- "{{ ansible_ssh_port | default(22) }}"
- "2379" # ETCD port
- "2380" # ETCD port
# - ""
consul_instances:
- 8300
- 8301
- 8302
- 8500
- 8600
balancers:
- "{{ ansible_ssh_port | default(22) }}"
- "{{ haproxy_listen_port.master }}" # HAProxy (read/write) master
- "{{ haproxy_listen_port.replicas }}" # HAProxy (read only) all replicas
- "{{ haproxy_listen_port.replicas_sync }}" # HAProxy (read only) synchronous replica only
- "{{ haproxy_listen_port.replicas_async }}" # HAProxy (read only) asynchronous replicas only
- "{{ haproxy_listen_port.stats }}" # HAProxy stats
# - ""
firewall_additional_rules_for:
master: []
replica: []
postgres_cluster: []
pgbackrest: []
etcd_cluster: []
consul_instances: []
balancers:
- "iptables -p vrrp -A INPUT -j ACCEPT" # Keepalived (vrrp)
- "iptables -p vrrp -A OUTPUT -j ACCEPT" # Keepalived (vrrp)
# disable firewalld (installed by default on RHEL/CentOS) or ufw (installed by default on Ubuntu)
firewall_disable_firewalld: true
firewall_disable_ufw: true
# (optional) - Fetch files from the server in the "master" group. These files can later be copied to all servers.
fetch_files_from_master: []
# - { src: "/etc/ssl/certs/ssl-cert-snakeoil.pem", dest: "files/ssl-cert-snakeoil.pem" }
# - { src: "/etc/ssl/private/ssl-cert-snakeoil.key", dest: "files/ssl-cert-snakeoil.key" }
# - { src: "/path/to/myfile", dest: "files/myfile" }
# (optional) - Copy this files to all servers in the cluster ("master" and "replica" groups)
copy_files_to_all_server: []
# - { src: "files/ssl-cert-snakeoil.pem", dest: "/etc/ssl/certs/ssl-cert-snakeoil.pem", owner: "postgres", group: "postgres", mode: "0644" }
# - { src: "files/ssl-cert-snakeoil.key", dest: "/etc/ssl/private/ssl-cert-snakeoil.key", owner: "postgres", group: "postgres", mode: "0600" }
# - { src: "files/myfile", dest: "/path/to/myfile", owner: "postgres", group: "postgres", mode: "0640" }
# System cron jobs
cron_jobs: []
# - name: "Example Job one"
# user: "postgres"
# file: /etc/cron.d/example_job_one
# minute: "00"
# hour: "1"
# day: "*"
# month: "*"
# weekday: "*"
# job: "echo 'example job one command'"
# - name: "Example Job two"
# user: "postgres"
# file: /etc/cron.d/example_job_two
# minute: "00"
# hour: "2"
# day: "*"
# month: "*"
# weekday: "*"
# job: "echo 'example job two command'"
# (optional) Configure mount points in /etc/fstab and mount the file system (if 'mount.src' is defined)
mount:
- path: "/pgdata"
src: "" # device UUID or path.
fstype: ext4 # if 'zfs' is specified a ZFS pool will be created
opts: defaults,noatime # not applicable to 'zfs'
state: mounted
# - path: "/pgwal"
# src: ""
# fstype: ext4
# opts: defaults,noatime
# state: mounted
# (optional) Execute custom commands or scripts
# This can be a direct command, a bash script content, or a path to a script on the host
pre_deploy_command: "" # Command or script to be executed before the Postgres cluster deployment
pre_deploy_command_timeout: 3600 # Timeout in seconds
pre_deploy_command_hosts: "postgres_cluster" # host groups where the pre_deploy_command should be executed
pre_deploy_command_print: true # Print the command in the ansible log
pre_deploy_command_print_result: true # Print the result of the command execution to the ansible log
post_deploy_command: "" # Command or script to be executed after the Postgres cluster deployment
post_deploy_command_timeout: 3600 # Timeout in seconds
post_deploy_command_hosts: "postgres_cluster" # host groups where the post_deploy_command should be executed
post_deploy_command_print: true # Print the command in the ansible log
post_deploy_command_print_result: true # Print the result of the command execution to the ansible log
...