An ansible role to install and configure postgresql
The following is the list of end-user serviceable parameters:
Global PostgreSQL configuration
Parameter | Default | Type | Description | Required |
---|---|---|---|---|
postgresql_release | 16 | string | Target PostgreSQL major release | false |
postgresql_user | postgres | string | OS user for postgres daemon | false |
postgresql_group | postgres | string | OS group for postgres daemon | false |
postgresql_package_state | present | string | PostgreSQL package state | false |
postgresql_service_state | started | string | PostgreSQL service state | false |
postgresql_service_enabled | true | bool | Start PostgreSQL on boot | false |
postgresql_roles | [] | list | List of PostgreSQL roles | false |
postgresql_databases | [] | list | List of PostgreSQL databases | false |
postgresql_hba_entries | [] | list | List of HBA entries | false |
postgresql_ident_entries | [] | list | List of ident entries | false |
postgresql_initdb | true | list | Toggle flag for database initialization | false |
postgresql_conf_main_file | postgresql.conf | string | Main config file basename | false |
postgresql_conf_ident_file | pg_ident.conf | string | Ident config file basename | false |
postgresql_conf_hba_file | pg_hba.conf | string | HBA config file basename | false |
postgresql_conf_main_manage | true | list | Toggle flag for postgresql.conf management | false |
postgresql_conf_hba_manage | true | list | Toggle flag for pg_hba.conf management | false |
postgresql_conf_ident_manage | true | list | Toggle flag for pg_ident.conf management | false |
postgresql_conf_socketdir_manage | true | list | Toggle flag for socket directory configuration | false |
postgresql_role_manage | true | list | Toggle flag for role management | false |
postgresql_datrabase_manage | true | list | Toggle flag for database management | false |
Please refer to the defaults directory for an up to date list of input parameters.
Role execution requires filters defined in nephelaiio.plugins collection to be available on the controller host
- name: Desploy PostgreSQL services
hosts: servers
roles:
- nephelaiio.postgresql_repo
- nephelaiio.postgresql
Please make sure your environment has docker installed in order to run role validation tests. Additional python dependencies are listed in the requirements file
Role is tested against the following distributions (docker images):
- Ubuntu Focal
- Ubuntu Bionic
- Debian Bookworm
- Debian Buster
- Rocky Linux 9
You can test the role directly from sources using command molecule test
Add support for sparse cloning external script repositories into path
This project is licensed under the terms of the MIT License