-
Notifications
You must be signed in to change notification settings - Fork 44
Roles Variables
Kostiantyn Nemchenko edited this page Dec 11, 2019
·
1 revision
- Description: Version of PostgreSQL to install
- Default:
11
- Description: Whether or not to install PostgreSQL and related packages
- Default:
false
- Description: Path to directory with Patroni configuration file
- Default:
/etc/patroni
- Description: OS user that will own PostgreSQL data files and Patroni process
- Default:
postgres
- Description: OS group that will own PostgreSQL data files and Patroni process
- Default:
postgres
- Description: Command to execute before the main Patroni process will be started
- Default:
/bin/mkdir -m 2750 -p /var/run/postgresql/{{ patroni_postgresql_version }}-main.pg_stat_tmp
- Description: List of PIP packages to install
- Default:
- {
name: "setuptools",
state: "latest",
umask: "0022",
executable: "pip3"
}
- {
name: "patroni[{{ patroni_dcs }}]",
state: "present",
umask: "0022",
executable: "pip3"
}
- Description: Name of the user that will be created during initialization. Replicas will use this user to access master via streaming replication
- Default:
replicator
- Description: Password of the user that will be used by replicas to access primary node via streaming replication
- Default:
repuserpasswd
- Description: Name of the user that will be created during initialization and later used by Patroni to connect to the local postgres instance. This user also will be used by Patroni to execute pg_rewind on PostgreSQL 10 and earlier versions.
- Default:
postgres
- Description: Password of the super user that will be used by Patroni to connect to PostgreSQL instance
- Default:
supersecretpostgrespasswd
- Description: Patroni cluster name
- Default:
main
- Description: Path within the configuration store where Patroni will keep information about the cluster
- Default:
/service/
- Description: Name of the node where the current instance of Patroni is running. Must be unique for the cluster
- Default:
{{ inventory_hostname }}
- Description: By default Patroni writes its logs into the stderr. If value for this variable is not equal to "stderr" then all logs will be written to the file
{{ patroni_log_dir }}/patroni.log
- Default:
stderr
- Description: General logging level
- Default:
INFO
- Description: Log formatting string
- Default:
%(asctime)s %(levelname)s: %(message)s
- Description: Datetime formatting string
- Default:
""
- Description: Patroni is using two-step logging. Log records are written into the in-memory queue and there is a separate thread which pulls them from the queue and writes to stderr or file. The maximum size of the internal queue is limited by amount of records specified by this parameter. Default value allows to keep logs for the past 80 minutes
- Default:
1000
- Description: Directory to write application logs to
- Default:
/var/log/patroni
- Description: Number of application logs to retain
- Default:
4
- Description: Size of the
{{ patroni_log_dir }}/patroni.log
file (in bytes) that triggers a log rolling - Default:
25000000
- Description: List of python modules along with their logging level
- Default:
- { module: "patroni.postmaster", level: "WARNING" }
- { module: "urllib3", level: "DEBUG" }
- Description: IP address and port that Patroni will listen to, to provide health-check information
- Default:
0.0.0.0:8008
- Description: IP address and port to access the REST API
- Default:
{{ ansible_host }}:8008
- Description: Specifies the file with the certificate in the PEM format. If the
{{ patroni_restapi_certfile }}
is not specified or is left empty, the API server will work without SSL - Default:
""
- Description: Specifies the file with the secret key in the PEM format
- Default:
""
- Description: Basic-auth username to protect unsafe REST API endpoints
- Default:
""
- Description: Basic-auth password to protect unsafe REST API endpoints
- Default:
""
- Description: Distributed configuration store type (etcd, consul, zookeeper or exhibitor)
- Default:
etcd
- Description: Whether or not to use a recommended Ansible role to setup a DCS. By default we expect you already have a preconfigured DCS cluster. Read more here
- Default:
true
- Description: host:port for the etcd endpoint
- Default:
""
- Description: List of etcd endpoint in format host1:port1,host2:port2,etc… Could be a comma separated string or an actual yaml list
- Default:
127.0.0.1:2379
- Description: If enabled Patroni will consider hosts as a list of proxies and will not perform a topology discovery of etcd cluster
- Default:
false
- Description: URL for the etcd
- Default:
""
- Description: Proxy URL for the etcd. If you are connecting to the etcd using proxy, use this parameter instead of
{{ patroni_etcd_url }}
- Default:
""
- Description: Domain to search the SRV record(s) for cluster autodiscovery
- Default:
""
- Description: Protocol used to establish communication between Patroni and Etcd. If the url or proxy is specified - will take protocol from them.
- Default:
http
- Description: User name for Etcd authentication
- Default:
""
- Description: User password for Etcd authentication
- Default:
""
- Description: Path to the CA certificate. If present it will enable validation
- Default:
""
- Description: Path to the file with the client certificate
- Default:
""
- Description: Path to the file with the client key. Can be empty if the key is part of
{{ patroni_etcd_cert }}
- Default:
""
- Description: host:port for the Consul endpoint, in format: http(s)://host:port
- Default:
127.0.0.1:{{ patroni_consul_port \|default(8500) }}
- Description: Consul port
- Default:
8500
- Description: URL for the Consul endpoint
- Default:
""
- Description: Protocol used to establish communication between Patroni and Consul
- Default:
http
- Description: Consul ACL token
- Default:
""
- Description: Whether to verify the SSL certificate for HTTPS requests
- Default:
""
- Description: Path to the CA certificate. If present it will enable validation
- Default:
""
- Description: Path to the file with the client certificate
- Default:
""
- Description: Path to the file with the client key. Can be empty if the key is part of
{{ patroni_consul_cert }}
- Default:
""
- Description: Datacenter to communicate with. By default the datacenter of the host is used
- Default:
""
- Description: List of Consul health checks used for the session. If not specified Consul will use “serfHealth” in additional to the TTL based check created by Patroni. Additional checks, in particular the “serfHealth”, may cause the leader lock to expire faster than in ttl seconds when the leader instance becomes unavailable
- Default:
""
- Description: Whether or not to register a service with the name defined by the scope parameter and the tag master, replica or standby-leader depending on the node’s role
- Default:
false
- Description: How often to perform health check against registered url
- Default:
5s
- Description: Defines consul consistency mode. Possible values are
default
,consistent
orstale
- Default:
default
- Description: List of ZooKeeper cluster members in format: ['host1:port1', 'host2:port2', 'etc…']
- Default:
127.0.0.1:2181
- Description: Initial list of Exhibitor (ZooKeeper) nodes in format: 'host1,host2,etc…'. This list updates automatically whenever the Exhibitor (ZooKeeper) cluster topology changes
- Default:
""
- Description: Exhibitor port
- Default:
""
- Description: How often the list of ZooKeeper and Exhibitor nodes should be updated from Exhibitor
- Default:
300
- Description: TTL to acquire the leader lock (in seconds). Think of it as the length of time before initiation of the automatic failover process
- Default:
30
- Description: Number of seconds the HA loop will sleep
- Default:
10
- Description: Timeout for DCS and PostgreSQL operation retries (in seconds). DCS or network issues shorter than this will not cause Patroni to demote the leader
- Default:
10
- Description: Maximum bytes a follower may lag to be able to participate in leader election
- Default:
1048576
- Description: Amount of time a master is allowed to recover from failures before failover is triggered (in seconds). Default is 300 seconds. When set to 0 failover is done immediately after a crash is detected if possible. When using asynchronous replication a failover can cause lost transactions. Worst case failover time for master failure is: loop_wait + master_start_timeout + loop_wait, unless master_start_timeout is zero, in which case it's just loop_wait. Set the value according to your durability/availability tradeoff
- Default:
300
- Description: Turns on synchronous replication mode. In this mode a replica will be chosen as synchronous and only the latest leader and synchronous replica are able to participate in leader election. Synchronous mode makes sure that successfully committed transactions will not be lost at failover, at the cost of losing availability for writes when Patroni cannot ensure transaction durability. See replication modes documentation for details
- Default:
false
- Description: Prevents disabling synchronous replication if no synchronous replicas are available, blocking all client writes to the master. See replication modes documentation for details
- Default:
false
- Description: By default, when running leader elections, Patroni does not take into account the current timeline of replicas, what in some cases could be undesirable behavior. You can prevent the node not having the same timeline as a former master become the new leader by changing the value of
check_timeline
parameter totrue
. It could happen that the node is considering itself as a healthiest one although it is currently not on the latest known timeline. In some cases we want to avoid promoting of such node, which could be achieved by setting check_timeline parameter to true (default behavior remains unchanged) - Default:
false
- Description: List of settings to bootstrap a standby cluster
- Default:
- { option: "host", value: "" }
- { option: "port", value: "" }
- { option: "primary_slot_name", value: "" }
- { option: "create_replica_methods", value: "" }
- { option: "restore_command", value: "" }
- { option: "archive_cleanup_command", value: "" }
- { option: "recovery_min_apply_delay", value: "" }
- Description: Whether or not to use pg_rewind on the former leader when it joins cluster as a replica
- Default:
false
- Description: Whether or not to use replication slots
- Default:
true
- Description: List of PostgreSQL configuration settings (GUCs) which will be stored in a DCS and later could be changed via
patronictl edit-config
- Default:
- { option: "max_connections", value: "100" }
- { option: "max_locks_per_transaction", value: "64" }
- { option: "max_worker_processes", value: "8" }
- { option: "max_prepared_transactions", value: "0" }
- { option: "wal_level", value: "replica" }
- { option: "wal_log_hints", value: "on" }
- { option: "track_commit_timestamp", value: "off" }
- { option: "max_wal_senders", value: "10" }
- { option: "max_replication_slots", value: "10" }
- { option: "wal_keep_segments", value: "8" }
- Description: List of additional configuration settings written to recovery.conf when configuring follower. There is no recovery.conf anymore in PostgreSQL 12, but you may continue using this section, because Patroni handles it transparently
- Default:
[]
- Description: List of lines that you should add to pg_hba.conf which will be stored in a DCS and later could be changed via
patronictl edit-config
- Default:
[]
- Description: Defines permanent replication slots. These slots will be preserved during switchover/failover. Patroni will try to create slots before opening connections to the cluster
- Default:
[]
- Description: Defines a section within a Patroni configuration file to bootstrap a cluster using user-defined script. See https://patroni.readthedocs.io/en/v1.6.1/replica_bootstrap.html#custom-bootstrap for details
- Default:
""
- Description: Defines a custom script with arguments to use for bootstrapping a cluster. See https://patroni.readthedocs.io/en/v1.6.1/replica_bootstrap.html#custom-bootstrap for details
- Default:
""
- Description: Whether or not to remove the existing recovery.conf file if it exists. This is useful when bootstrapping from a backup with tools like pgBackRest that generate the appropriate recovery.conf for you
- Default:
false
- Description: List of additional configuration settings written to recovery.conf. If enabled, Patroni will generate a recovery.conf before starting the newly bootstrapped instance. Typically, such recovery.conf should contain at least one of the
recovery_target_*
parameters, together with therecovery_target_timeline
set topromote
- Default:
[]
- Description: List options to be passed on to initdb
- Default:
- { option: "encoding", value: "UTF8" }
- { option: "data-checksums" }
- Description: List of lines that you should add to pg_hba.conf
- Default:
[]
- Description: Path to a script that will be executed after initializing the cluster. The script receives a connection string URL (with the cluster superuser as a user name). The PGPASSFILE environment variable is set to the location of pgpass file
- Default:
""
- Description: Path to a script that will be executed after initializing the cluster. The script receives a connection string URL (with the cluster superuser as a user name). The PGPASSFILE environment variable is set to the location of pgpass file
- Default:
""
- Description: List of additional users along with their passwords and
CREATE USER
options which need to be created after initializing new cluster - Default:
- {
name: "{{ patroni_superuser_username }}",
password: "{{ patroni_superuser_password }}",
options: []
}
- {
name: "{{ patroni_replication_username }}",
password: "{{ patroni_replication_password }}",
options: ['replication']
}
- Description: Specifies that Patroni should prefer to use unix sockets to connect to the cluster. If unix_socket_directories is defined, Patroni will use the first suitable value from it to connect to the cluster and fallback to tcp if nothing is suitable. If unix_socket_directories is not specified in postgresql.parameters, Patroni will assume that the default value should be used and omit host from the connection parameters
- Default:
true
- Description: IP address + port that Postgres listens to; must be accessible from other nodes in the cluster, if you’re using streaming replication. Multiple comma-separated addresses are permitted, as long as the port component is appended after to the last one with a colon, i.e. listen: 127.0.0.1,127.0.0.2:5432. Patroni will use the first address from this list to establish local connections to the PostgreSQL node
- Default:
0.0.0.0:5432
- Description: IP address + port through which Postgres is accessible from other nodes and applications
- Default:
{{ ansible_host }}:5432
- Description: List of users which will be created during initialization and later used by Patroni to connect to the postgres, access master via streaming replication and execute pg_rewind
- Default:
- {
type: "superuser",
username: "{{ patroni_superuser_username }}",
password: "{{ patroni_superuser_password }}"
}
- {
type: "replication",
username: "{{ patroni_replication_username }}",
password: "{{ patroni_replication_password }}"
}
- Description: List of callback scripts which should be present on the postgres node to run on certain actions. Patroni will pass the action, role and cluster name as an arguments
- Default:
- { event: "on_reload", script: "" }
- { event: "on_restart", script: "" }
- { event: "on_role_change", script: "" }
- { event: "on_start", script: "" }
- { event: "on_stop", script: "" }
- Description: An ordered list of the create methods for turning a Patroni node into a new replica. "basebackup" is the default method; other methods are assumed to refer to scripts, each of which is configured as its own config item. See custom replica creation methods documentation for further explanation
- Default:
['basebackup']
- Description: List of pgBackRest method specific options
- Default:
[]
- Description: List of WAL-E method specific options
- Default:
[]
- Description: List of pg_basebackup method specific options
- Default:
[]
- Description: List of additional configuration settings written to recovery.conf when configuring follower
- Default:
[]
- Description: Path to an optional custom postgresql.conf file, that will be used in place of postgresql.base.conf. The file must exist on all cluster nodes, be readable by PostgreSQL and will be included from its location on the real postgresql.conf. Note that Patroni will not monitor this file for changes, nor backup it. However, its settings can still be overridden by Patroni’s own configuration facilities - see dynamic configuration for details
- Default:
""
- Description: List of PostgreSQL configuration settings (GUCs)
- Default:
[{ option: "unix_socket_directories", value: "/var/run/postgresql" }]
- Description: List of lines that Patroni will use to generate pg_hba.conf. This parameter has higher priority than
{{ patroni_bootstrap_pg_hba }}
- Default:
[]
- Description: How long should pg_ctl wait when doing start, stop or restart
- Default:
60
- Description: If this option is enabled, Patroni will remove the PostgreSQL data directory and recreate the replica. Otherwise it will try to follow the new leader
- Default:
false
- Description: Patroni will remove the PostgreSQL data directory and recreate the replica if it notices that timelines are diverging and the former master can not start streaming from the new master. This option is useful when pg_rewind can not be used
- Default:
false
- Description: Possible values are
off
,automatic
orrequired
. Whenoff
watchdog is disabled. Whenautomatic
watchdog will be used if available, but ignored if it is not. Whenrequired
the node will not become a leader unless watchdog can be successfully enabled - Default:
automatic
- Description: Path to watchdog device
- Default:
/dev/watchdog
- Description: Number of seconds of safety margin between watchdog triggering and leader key expiration
- Default:
5
- Description: List of Patroni tags to assign to the current cluster member
- Default:
- { name: "nofailover", value: "false" }
- { name: "noloadbalance", value: "false" }
- { name: "clonefrom", value: "false" }
- { name: "nosync", value: "false" }
- { name: "replicatefrom", value: "" }
Empty footer