Initial commit of PVC Ansible role

This commit is contained in:
2023-09-01 15:42:19 -04:00
commit 6dfaf433dc
92 changed files with 4709 additions and 0 deletions

View File

@ -0,0 +1,63 @@
scope: pvcdns
namespace: /patroni
name: {{ ansible_hostname }}
restapi:
listen: '0.0.0.0:8008'
connect_address: '{{ ansible_fqdn }}:8008'
zookeeper:
hosts: [ {% for host in groups[ansible_local.host_group] %}'{{ host }}.{{ ansible_domain }}:2181',{% endfor %} ]
bootstrap:
dcs:
ttl: 30
loop_wait: 10
retry_timeout: 10
maximum_lag_on_failover: 1048576
postgresql:
use_pg_rewind: true
initdb:
- encoding: UTF8
- data-checksums
pg_hba:
- local all all peer
- host replication replicator 127.0.0.1/32 trust
{% for host in groups[ansible_local.host_group] %}
- host replication replicator {{ host }}.{{ ansible_domain }} trust
{% endfor %}
- host all all 0.0.0.0/0 md5
users:
admin:
password: admin
options:
- createrole
- createdb
postgresql:
listen: '0.0.0.0:5432'
connect_address: '{{ ansible_fqdn }}:5432'
log_destination: 'stderr'
log_min_messages: INFO
custom_conf: /etc/postgresql/postgresql.pvc.conf
bin_dir: /usr/lib/postgresql/11/bin
data_dir: /var/lib/postgresql/patroni/pvc
pgpass: /tmp/pgpass
authentication:
replication:
username: '{{ pvc_replication_database_user }}'
password: '{{ pvc_replication_database_password }}'
superuser:
username: '{{ pvc_superuser_database_user }}'
password: '{{ pvc_superuser_database_password }}'
parameters:
unix_socket_directories: '/run/postgresql'
tags:
nofailover: false
noloadbalance: false
clonefrom: false
nosync: false

View File

@ -0,0 +1,21 @@
# Additional PostgreSQL tuning parameters for PVC Patroni instance
# {{ ansible_managed }}
max_connections = 100
shared_buffers = 64MB
effective_cache_size = 256MB
dynamic_shared_memory_type = posix
random_page_cost = 1
seq_page_cost = 1
log_timezone = 'localtime'
datestyle = 'iso, dmy'
timezone = 'localtime'
lc_messages = 'en_CA.UTF-8'
lc_monetary = 'en_CA.UTF-8'
lc_numeric = 'en_CA.UTF-8'
lc_time = 'en_CA.UTF-8'
default_text_search_config = 'pg_catalog.english'