An Ansible Role to install and configure postgresql.
Postgresql is a very common database server, used by many applications, teams and companies.
This role installs and configures postgresql.
- install postgresql
- configure postgresql user
- configure hba access
Used Modules:
- Ansible Package Module
- Ansible Service Module
- Ansible package_facts Module
- Ansible User Module
- Ansible File Module
- Ansible Stat Module
- Ansible Command Module
- Ansible Template Module
- Ansible Firewalld Module
Install from Ansible Galaxy
ansible-galaxy install while_true_do.srv_postgresql
Install from Github
git clone https://github.com/while-true-do/ansible-role-srv_postgresql.git while_true_do.srv_postgresql
---
# defaults file for while_true_do.srv_postgresql
## Package Management
wtd_srv_postgresql_package:
- postgresql-server
- postgresql-contrib
# State can be present|latest|absent
wtd_srv_postgresql_package_state: "present"
## User Management
# This user will also be ths postgres super user
wtd_srv_postgresql_user:
name: "postgres"
group: "postgres"
## Configuration Management
wtd_srv_postgresql_conf_data: "/var/lib/pgsql/data"
# For local connections via postgres_user defaults will be set
wtd_srv_postgresql_conf_hba: []
# - type: "local"
# database: "all"
# user: "all"
# method: "peer"
# - type: "host"
# database: "somedatabase"
# user: "someuser"
# address: "192.168.10.0/24"
# method: "ident"
## Service Management
wtd_srv_postgresql_service: "postgresql"
# State can be started|stopped
wtd_srv_postgresql_service_state: "started"
wtd_srv_postgresql_service_enabled: true
## Firewalld Management
wtd_srv_postgresql_fw_mgmt: true
wtd_srv_postgresql_fw_service: "postgresql"
# State can be enabled|disabled
wtd_srv_postgresql_fw_state: "enabled"
# Zone can be according to defined zones on your machine.
wtd_srv_postgresql_fw_zone: "public"
Running Ansible Roles can be done in a playbook.
---
- hosts: all
roles:
- role: while_true_do.srv_postgresql
- RedHat Testing is currently not possible in public, due to limitations in subscriptions.
- Some services and features cannot be tested properly, due to limitations in docker.
Most of the "generic" tests are located in the Test Library.
Ansible specific testing is done with Molecule.
Infrastructure testing is done with testinfra.
Automated testing is done with Travis CI.
Thank you so much for considering to contribute. We are very happy, when somebody is joining the hard work. Please fell free to open Bugs, Feature Requests or Pull Requests after reading the Contribution Guideline.
See who has contributed already in the kudos.txt.
This work is licensed under a BSD-3-Clause License.
- Site https://while-true-do.io
- Twitter https://twitter.com/wtd_news
- Code https://github.com/while-true-do
- Mail [email protected]
- IRC freenode, #while-true-do
- Telegram https://t.me/while_true_do