Skip to content

NETWAYS/ansible-role-patroni

Repository files navigation

Ansible Role for Patroni

CI

An Ansible role which installs and configures Patroni - HA solution for PostgreSQL.

This branch is managed by NETWAYS.

Requirements

This role requires root privileges, so tell ansible to use become: true in any convenient way for you.

We are testing the following distributions:

  • Rockylinux 8 (although it's EOL, we need it for a certain project)
  • Rockylinux 9
  • Debian 12

Because Rockylinux 8 is incompatible to some changes in Ansible > 2.16 and the Ansible collection community.crypto 3.0.0+ we only test with these versions pinned. The role should work with newer versions as well but right now we don't have tests for it.

Role Variables

Coming soon.

Note on Patroni API endpoint for HAProxy health checks

Starting with Patroni version 4.0.0, the /master API endpoint has been deprecated and replaced by /primary.
To ensure compatibility with newer versions, the HAProxy health check is configured to use the /primary endpoint.

Dependencies

There are no dependencies for the role, but Patroni itself needs a DCS (Etcd, Consul, ZooKeeper or Exhibitor) to be installed and configured properly and it's your responsibility to make it up and running before using this role. Currently, it is supposed that a DCS is prepared. Otherwise, you can try one of the following roles (just uncomment respective section here and set patroni_dcs_exists variable to false):

Example Playbook

- hosts: postgresql-servers
  become: yes
  roles:
    - kostiantyn-nemchenko.patroni

License

MIT

Author Information

Kostiantyn Nemchenko kostiantyn.nemchenko@gmail.com