All Projects → ANXS → Postgresql

ANXS / Postgresql

Licence: mit
Fairly full featured Ansible role for Postgresql.

Projects that are alternatives of or similar to Postgresql

Nexus3 Oss
Ansible role to install and provision sonatype nexus3-oss
Stars: ✭ 169 (-75.29%)
Mutual labels:  ansible, ansible-role
Ansible Playbook Grapher
A command line tool to create a graph representing your Ansible playbook tasks and roles
Stars: ✭ 234 (-65.79%)
Mutual labels:  ansible, ansible-role
Graylog Ansible Role
Ansible role which installs and configures Graylog
Stars: ✭ 173 (-74.71%)
Mutual labels:  ansible, ansible-role
Nginx
A fairly flexible and feature full Ansible role for the NGINX web server.
Stars: ✭ 151 (-77.92%)
Mutual labels:  ansible, ansible-role
Ansible Consul
📡 Ansible role for Hashicorp Consul clusters
Stars: ✭ 320 (-53.22%)
Mutual labels:  ansible, ansible-role
Ansible Nomad
⌚️ Ansible role for Nomad
Stars: ✭ 157 (-77.05%)
Mutual labels:  ansible, ansible-role
Ansible Role Awx
Ansible Role - AWX
Stars: ✭ 228 (-66.67%)
Mutual labels:  ansible, ansible-role
Ansible Role Ssl Certs
Generate and/or deploy SSL certificate
Stars: ✭ 122 (-82.16%)
Mutual labels:  ansible, ansible-role
Ansible Role Postgresql
Ansible Role - PostgreSQL
Stars: ✭ 310 (-54.68%)
Mutual labels:  ansible, postgresql
Postgresql cluster
PostgreSQL High-Availability Cluster (based on "Patroni" and "DCS(etcd)"). Automating deployment with Ansible.
Stars: ✭ 294 (-57.02%)
Mutual labels:  ansible, postgresql
Ansible Role K3s
Ansible role for installing k3s as either a standalone server or HA cluster.
Stars: ✭ 132 (-80.7%)
Mutual labels:  ansible, ansible-role
Ansible Letsencrypt
An ansible role to generate TLS certificates and get them signed by Let's Encrypt
Stars: ✭ 433 (-36.7%)
Mutual labels:  ansible, ansible-role
Sensu Ansible
An Ansible role to deploy a fully dynamic Sensu stack!
Stars: ✭ 126 (-81.58%)
Mutual labels:  ansible, ansible-role
Ansible Relayor
An Ansible Role for Tor Relay Operators
Stars: ✭ 165 (-75.88%)
Mutual labels:  ansible, ansible-role
Mattermost Ansible
Ansible playbook to provide a turnkey solution for the Team Edition of Mattermost
Stars: ✭ 126 (-81.58%)
Mutual labels:  ansible, postgresql
Ansible Role Wireguard
Ansible role for installing WireGuard VPN. Supports Ubuntu, Debian, Archlinx, Fedora and CentOS.
Stars: ✭ 176 (-74.27%)
Mutual labels:  ansible, ansible-role
Ansible Elasticsearch
Ansible playbook for Elasticsearch
Stars: ✭ 1,316 (+92.4%)
Mutual labels:  ansible, ansible-role
Ansible Openwisp2 Imagegenerator
Automatically build several openwisp2 firmware images for different organizations while keeping track of their differences
Stars: ✭ 122 (-82.16%)
Mutual labels:  ansible, ansible-role
Rvm1 Ansible
The official ansible RVM role to install and manage your Ruby versions.
Stars: ✭ 246 (-64.04%)
Mutual labels:  ansible, ansible-role
Ansible Role Nginx
Ansible role for NGINX
Stars: ✭ 404 (-40.94%)
Mutual labels:  ansible, ansible-role

ANXS - PostgreSQL Build Status


Help Wanted! If you are able and willing to help maintain this Ansible role then please open a GitHub issue. A lot of people seem to use this role and we (quite obviously) need assistance! 💖

Ansible role which installs and configures PostgreSQL, extensions, databases and users.

Installation

This has been tested on Ansible 2.4.0 and higher.

To install:

ansible-galaxy install anxs.postgresql

Example Playbook

An example how to include this role:

---
- hosts: postgresql-server
  roles:
    - role: ANXS.postgresql
      become: yes

An example how to include this role as a task:

---
- hosts: postgresql-server
  tasks:
    - block: # workaround, see https://stackoverflow.com/a/56558842
        - name: PSQL installation and configuration
          include_role:
            name: ANXS.postgresql
          vars:
            postgresql_users:
              - name: abc
                password: abc
      become: true

Dependencies

  • ANXS.monit (Galaxy/GH) if you want monit protection (in that case, you should set monit_protection: true)

Compatibility matrix

Distribution / PostgreSQL 9.5 9.6 10 11 12 13
CentOS 7.x
CentOS 8.x
Debian 9.x
Debian 10.x
Ubuntu 18.04.x
Ubuntu 20.04.x
Fedora latest
  • ✅ - tested, works fine
  • ⚠️ - Not for production use
  • ❔ - will work in the future (help out if you can)
  • ⁉️ - maybe works, not tested
  • ⛔️ - Has reached End of Life (EOL)

Variables

# Basic settings
postgresql_version: 13
postgresql_encoding: "UTF-8"
postgresql_locale: "en_US.UTF-8"
postgresql_ctype: "en_US.UTF-8"

postgresql_admin_user: "postgres"
postgresql_default_auth_method: "peer"

postgresql_service_enabled: false # should the service be enabled, default is true

postgresql_cluster_name: "main"
postgresql_cluster_reset: false

# List of databases to be created (optional)
# Note: for more flexibility with extensions use the postgresql_database_extensions setting.
postgresql_databases:
  - name: foobar
    owner: baz          # optional; specify the owner of the database
    hstore: yes         # flag to install the hstore extension on this database (yes/no)
    uuid_ossp: yes      # flag to install the uuid-ossp extension on this database (yes/no)
    citext: yes         # flag to install the citext extension on this database (yes/no)
    encoding: "UTF-8"   # override global {{ postgresql_encoding }} variable per database
    state: "present"    # optional; one of 'present', 'absent', 'dump', 'restore'
    lc_collate: "en_GB.UTF-8"   # override global {{ postgresql_locale }} variable per database
    lc_ctype: "en_GB.UTF-8"     # override global {{ postgresql_ctype }} variable per database

# List of database extensions to be created (optional)
postgresql_database_extensions:
  - db: foobar
    extensions:
      - hstore
      - citext

# List of users to be created (optional)
postgresql_users:
  - name: baz
    pass: pass
    encrypted: yes  # if password should be encrypted, postgresql >= 10 does only accepts encrypted passwords
    state: "present"    # optional; one of 'present', 'absent'

# List of schemas to be created (optional)
postgresql_database_schemas:
  - database: foobar           # database name
    schema: acme               # schema name
    state: present

  - database: foobar           # database name
    schema: acme_baz           # schema name
    owner: baz                 # owner name
    state: present

# List of user privileges to be applied (optional)
postgresql_user_privileges:
  - name: baz                   # user name
    db: foobar                  # database
    priv: "ALL"                 # privilege string format: example: INSERT,UPDATE/table:SELECT/anothertable:ALL
    role_attr_flags: "CREATEDB" # role attribute flags

There's a lot more knobs and bolts to set, which you can find in the defaults/main.yml

Testing

This project comes with a Vagrantfile, this is a fast and easy way to test changes to the role, fire it up with vagrant up

See vagrant docs for getting setup with vagrant

Once your VM is up, you can reprovision it using either vagrant provision, or ansible-playbook tests/playbook.yml -i vagrant-inventory

If you want to toy with the test play, see tests/playbook.yml, and change the variables in tests/vars.yml

If you are contributing, please first test your changes within the vagrant environment, (using the targeted distribution), and if possible, ensure your change is covered in the tests found in .travis.yml

License

Licensed under the MIT License. See the LICENSE file for details.

Thanks

Creator:

Maintainers:

Top Contributors:

Feedback, bug-reports, requests, ...

Are welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].