{"id":14984426,"url":"https://github.com/anxs/postgresql","last_synced_at":"2025-05-14T11:12:58.255Z","repository":{"id":14904089,"uuid":"17628006","full_name":"ANXS/postgresql","owner":"ANXS","description":"Fairly full featured Ansible role for Postgresql.","archived":false,"fork":false,"pushed_at":"2025-03-17T14:08:37.000Z","size":709,"stargazers_count":876,"open_issues_count":12,"forks_count":579,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-04-03T21:49:56.295Z","etag":null,"topics":["ansible","ansible-role","postgresql"],"latest_commit_sha":null,"homepage":"http://anxs.io/","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ANXS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-03-11T11:27:43.000Z","updated_at":"2025-03-20T17:33:26.000Z","dependencies_parsed_at":"2024-05-28T12:01:22.670Z","dependency_job_id":"d5bc7883-3259-46f6-bde8-02db82d02861","html_url":"https://github.com/ANXS/postgresql","commit_stats":{"total_commits":493,"total_committers":107,"mean_commits":4.607476635514018,"dds":0.8985801217038539,"last_synced_commit":"d99c9d62f7b2557c4987da5e475ffc9bb2721ee7"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ANXS%2Fpostgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ANXS%2Fpostgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ANXS%2Fpostgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ANXS%2Fpostgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ANXS","download_url":"https://codeload.github.com/ANXS/postgresql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248340373,"owners_count":21087439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-role","postgresql"],"created_at":"2024-09-24T14:09:01.510Z","updated_at":"2025-04-11T04:22:40.997Z","avatar_url":"https://github.com/ANXS.png","language":"Jinja","readme":"## ANXS - PostgreSQL [![Build Status](https://github.com/ANXS/postgresql/actions/workflows/ci.yml/badge.svg)](https://github.com/ANXS/postgresql/actions/workflows/ci.yml)\n\n---\nHelp 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!\n💖\n---\n\nAnsible role which installs and configures PostgreSQL, extensions, databases and users.\n\n\n#### Installation\n\nThis has been tested on Ansible 2.4.0 and higher.\n\nTo install:\n\n```\nansible-galaxy install anxs.postgresql\n```\n\n#### Example Playbook\n\nAn example how to include this role:\n\n```yml\n---\n- hosts: postgresql-server\n  roles:\n    - role: ANXS.postgresql\n      become: yes\n```\n\nAn example how to include this role as a task:\n\n```yml\n---\n- hosts: postgresql-server\n  tasks:\n    - block: # workaround, see https://stackoverflow.com/a/56558842\n        - name: PSQL installation and configuration\n          include_role:\n            name: ANXS.postgresql\n          vars:\n            postgresql_users:\n              - name: abc\n                password: abc\n      become: true\n```\n\n#### Dependencies\n\n- ANXS.monit ([Galaxy](https://galaxy.ansible.com/list#/roles/502)/[GH](https://github.com/ANXS/monit)) if you want monit protection (in that case, you should set `monit_protection: true`)\n\n\n#### Compatibility matrix\n\n| Distribution / PostgreSQL |     11     |         12         |         13         |         14         |         15         |         16         |        17          |\n| ------------------------- | :--------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |\n| Debian 11.x               | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| Debian 12.x               | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| Rockylinux 8.x            | :no_entry: |     :warning:      |     :warning:      |     :warning:      |     :warning:      |     :warning:      |     :warning:      |\n| Rockylinux 9.x            | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |     :warning:      |\n| Ubuntu 20.04.x            | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| Ubuntu 22.04.x            | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| Ubuntu 24.04.x            | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n\n\n- :white_check_mark: - works fine\n- :warning: - has known issues\n- :no_entry: - is unsupported and/or EOL\n\n\n#### Variables\n\n```yaml\n# Basic settings\npostgresql_version: 17\npostgresql_encoding: \"UTF-8\"\npostgresql_locale: \"en_US.UTF-8\"\npostgresql_ctype: \"en_US.UTF-8\"\n\npostgresql_admin_user: \"postgres\"\npostgresql_default_auth_method: \"peer\"\n\npostgresql_cluster_name: main\npostgresql_cluster_reset: false\n\n# List of databases to be created (optional)\n# Note: for more flexibility with extensions use the postgresql_database_extensions setting.\npostgresql_databases:\n  - name: foobar\n    owner: baz          # optional; specify the owner of the database\n    hstore: yes         # flag to install the hstore extension on this database (yes/no)\n    uuid_ossp: yes      # flag to install the uuid-ossp extension on this database (yes/no)\n    citext: yes         # flag to install the citext extension on this database (yes/no)\n    encoding: \"UTF-8\"   # override global {{ postgresql_encoding }} variable per database\n    state: \"present\"    # optional; one of 'present', 'absent', 'dump', 'restore'\n    lc_collate: \"en_GB.UTF-8\"   # override global {{ postgresql_locale }} variable per database\n    lc_ctype: \"en_GB.UTF-8\"     # override global {{ postgresql_ctype }} variable per database\n\n# List of database extensions to be created (optional)\npostgresql_database_extensions:\n  - db: foobar\n    extensions:\n      - hstore\n      - citext\n\n# List of users to be created (optional)\npostgresql_users:\n  - name: baz\n    pass: pass\n    encrypted: yes  # if password should be encrypted, postgresql \u003e= 10 does only accepts encrypted passwords\n    state: \"present\"    # optional; one of 'present', 'absent'\n\n# List of schemas to be created (optional)\npostgresql_database_schemas:\n  - database: foobar           # database name\n    schema: acme               # schema name\n    state: present\n\n  - database: foobar           # database name\n    schema: acme_baz           # schema name\n    owner: baz                 # owner name\n    state: present\n\n# List of user privileges to be applied (optional)\npostgresql_user_privileges:\n  - name: baz                   # user name\n    db: foobar                  # database\n    priv: \"ALL\"                 # privilege string format: example: INSERT,UPDATE/table:SELECT/anothertable:ALL\n    role_attr_flags: \"CREATEDB\" # role attribute flags\n```\n\nThere's a lot more knobs and bolts to set, which you can find in the [defaults/main.yml](./defaults/main.yml)\n\n\n#### Testing - Molecule\n\nThis project comes with a molecule configuration. Please see [./molecule/README.md](./molecule/README.md)\n\nExamples:\n\n```\nmolecule test\n```\n\n#### Testing - Vagrant\n\nThis project comes with a Vagrantfile, this is a fast and easy way to test changes to the role, fire it up with `vagrant up`\n\nSee [vagrant docs](https://docs.vagrantup.com/v2/) for getting setup with vagrant\n\nOnce your VM is up, you can reprovision it using either `vagrant provision`, or `ansible-playbook tests/playbook.yml -i vagrant-inventory`\n\nIf you want to toy with the test play, see [tests/playbook.yml](./tests/playbook.yml), and change the variables in [tests/vars.yml](./tests/vars.yml)\n\nIf 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](./.travis.yml)\n\n#### License\n\nLicensed under the MIT License. See the [LICENSE](./LICENSE) file for details.\n\n#### Thanks\n\nCreator:\n- [Pjan Vandaele](https://github.com/pjan)\n\nMaintainers:\n- [Jonathan Lozada D.](https://github.com/jlozadad)\n- [Jonathan Freedman](https://github.com/otakup0pe)\n- [Sergei Antipov](https://github.com/UnderGreen)\n- [Greg Clough](https://github.com/gclough)\n- [Magnus Lübeck](https://github.com/maglub)\n- [Leo C.](https://github.com/MrMegaNova)\n- [Laurent Lavaud](https://github.com/fidelio33b)\n\nTop Contributors:\n- [David Farrington](https://github.com/farridav)\n- [Jesse Lang](https://github.com/jesselang)\n- [Michael Conrad](https://github.com/MichaelConrad)\n- [Sébastien Alix](https://github.com/sebalix)\n- [Copperfield](https://github.com/Copperfield)\n- [T. Soulabail](https://github.com/tsoulabail)\n- [Ralph von der Heyden](https://github.com/ralph)\n\n\n#### Feedback, bug-reports, requests, ...\n\nAre [welcome](https://github.com/ANXS/postgresql/issues)!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanxs%2Fpostgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanxs%2Fpostgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanxs%2Fpostgresql/lists"}