Debian Codegraph @

ansible_collections/community/postgresql/README.md

raw
1 # PostgreSQL collection for Ansible
2 | | | | |
3 |--|--|--|--|
4 |[![Build Status](https://dev.azure.com/ansible/community.postgres/_apis/build/status/CI?branchName=main)](https://dev.azure.com/ansible/community.postgres/_build?definitionId=28)|[![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.postgresql)](https://codecov.io/gh/ansible-collections/community.postgresql)| |[![Discuss on Matrix at #postgresql:ansible.com](https://img.shields.io/matrix/postgresql:ansible.com.svg?server_fqdn=ansible-accounts.ems.host&label=Discuss%20on%20Matrix%20at%20%23postgresql:ansible.com&logo=matrix)](https://matrix.to/#/#postgresql:ansible.com)|
5
6 This collection is a part of the Ansible package.
7
8 > NOTE: This collection is only for interacting with an existing database installation! If you are looking for a collection to *install* PostgreSQL you need to use another collection/role, for example, [galaxyproject.postgresql](https://galaxy.ansible.com/ui/standalone/roles/galaxyproject/postgresql/install/).
9
10 ## Our mission
11
12 At the `community.postgresql` Ansible collection project,
13 our mission is to produce and maintain simple, flexible,
14 and powerful open-source software tailored to automating PostgreSQL-related tasks.
15
16 We welcome members from all skill levels to participate actively in our open, inclusive, and vibrant community.
17 Whether you are an expert or just beginning your journey with Ansible and PostgreSQL,
18 you are encouraged to contribute, share insights, and collaborate with fellow enthusiasts.
19
20 We strive to make managing PostgreSQL deployments as effortless and efficient as possible with automation,
21 enabling users to focus on their core objectives.
22
23 ## Code of Conduct
24
25 We follow the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our interactions within this project.
26
27 If you encounter abusive behavior violating the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html), please refer to the [policy violations](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html#policy-violations) section of the Code of Conduct for information on how to raise a complaint.
28
29 ## Communication
30
31 * Join the Ansible forum:
32 * [PostgreSQL Team](https://forum.ansible.com/g/PostgreSQLTeam): by joining the team you will automatically get subscribed to the posts tagged with [postgresql](https://forum.ansible.com/tag/postgresql).
33 * [Get Help](https://forum.ansible.com/c/help/6): get help or help others.
34 * [Posts tagged with 'postgresql'](https://forum.ansible.com/tag/postgresql): leverage tags to narrow the scope.
35 * [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
36 * [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
37
38 * The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
39 * [Matrix](https://docs.ansible.com/ansible/devel/community/communication.html#real-time-chat): chat real-time about contributing/maintenance-related topics in the [#postgresql:ansible.com](https://matrix.to/#/#postgresql:ansible.com) room.
40
41 For more information about communication see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
42
43 ## Contributing to this collection
44
45 The content of this collection is made by [people](https://github.com/ansible-collections/community.postgresql/graphs/contributors) just like you; a community of individuals collaborating on making the world better through developing automation software.
46
47 We are actively accepting new contributors and all types of contributions are very welcome.
48
49 You don't know how to start? Refer to our [contribution guide](https://github.com/ansible-collections/community.postgresql/blob/main/CONTRIBUTING.md)!
50
51 We use the following guidelines:
52
53 * [CONTRIBUTING.md](https://github.com/ansible-collections/community.postgresql/blob/main/CONTRIBUTING.md)
54 * [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html)
55 * [Ansible Development Guide](https://docs.ansible.com/ansible/devel/dev_guide/index.html)
56 * [Ansible Collection Development Guide](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections)
57
58 ## Collection maintenance
59
60 The current maintainers (contributors with `write` or higher access) are listed in the [MAINTAINERS](https://github.com/ansible-collections/community.postgresql/blob/main/MAINTAINERS) file. If you have questions or need help, feel free to mention them in the proposals.
61
62 To learn how to maintain / become a maintainer of this collection, refer to the [Maintainer guidelines](https://github.com/ansible-collections/community.postgresql/blob/main/MAINTAINING.md).
63
64 It is necessary for maintainers of this collection to be subscribed to:
65
66 * The collection itself (the `Watch` button -> `All Activity` in the upper right corner of the repository's homepage).
67 * The [news-for-maintainers repository](https://github.com/ansible-collections/news-for-maintainers).
68
69 They also should be subscribed to Ansible's [The Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn).
70
71 ## Governance
72
73 We, [the PostgreSQL working group](https://forum.ansible.com/g/PostgreSQLTeam), use [the forum](https://forum.ansible.com/tag/postgresql) posts tagged with `postgresql` for general announcements and discussions.
74
75 The process of decision making in this collection is based on discussing and finding consensus among participants.
76
77 Every voice is important and every idea is valuable. If you have something on your mind, create an issue or dedicated forum [discussion](https://forum.ansible.com/new-topic?title=topic%20title&body=topic%20body&category=project&tags=postgresql) and let's discuss it!
78
79 ## External requirements
80
81 The PostgreSQL modules rely on the [Psycopg](https://www.psycopg.org/) PostgreSQL database adapter.
82 Both versions [Psycopg2](https://www.psycopg.org/docs/) and [Psycopg3](https://www.psycopg.org/psycopg3/docs/) are supported.
83 The minimum supported and tested versions of Psycopg are 2.5.1 and 3.1.8 respectively.
84
85 ## Releases Support Timeline
86
87 We maintain each major release version (1.x.y, 2.x.y, ...) for two years after the next major version is released.
88
89 Here is the table for the support timeline:
90 - 1.x.y: released 2020-11-17, EOL
91 - 2.x.y: released 2022-02-10, EOL
92 - 3.x.y: released 2023-06-09, maintained until 2027-05-06 (bugfixes only)
93 - 4.x.y: released 2025-05-06, current
94 - 5.x.y: to be released; not earlier than Ansible 14 release (~May 2026)
95
96 ## PostgreSQL server version support
97
98 The collection supports PostgreSQL server versions officially supported by the PostgreSQL Global Development Group.
99 EOL versions are NOT taken into account during development.
100 Even if they are present in our test matrix now, they can be removed at any moment.
101
102 ## Tested with ansible-core
103
104 Tested with the following `ansible-core` releases:
105 - 2.16
106 - 2.17
107 - 2.18
108 - 2.19
109 - 2.20
110 - current development version
111
112 Ansible-core versions before 2.12.0 are not supported.
113 Our AZP CI includes testing with the following docker images / PostgreSQL versions:
114
115 | Docker image | Psycopg version | PostgreSQL version |
116 |--------------|-----------------|--------------------|
117 | RHEL 9 | 2.9.6 | 13 |
118 | Fedora 39 | 2.9.6 | 15 |
119 | Ubuntu 22.04 | 3.1.9 | 16 |
120 | Fedora 40/41 | 2.9.9 | 16 |
121 | RHEL 10 | 2.9.9 | 16 |
122 | Ubuntu 24.04 | 3.2.2 | 17 |
123
124 ## Included content
125
126 - **Info modules**:
127 - [postgresql_info](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_info_module.html)
128 - [postgresql_ping](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_ping_module.html)
129 - [postgresql_user_obj_stat_info](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_user_obj_stat_info_module.html)
130
131 - **Basic modules**:
132 - [postgresql_db](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_db_module.html)
133 - [postgresql_ext](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_ext_module.html)
134 - [postgresql_pg_hba](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_pg_hba_module.html)
135 - [postgresql_privs](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_privs_module.html)
136 - [postgresql_alter_system](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_alter_system_module.html) (will replace `postgresql_set`)
137 - [postgresql_schema](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_schema_module.html)
138 - [postgresql_tablespace](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_tablespace_module.html)
139 - [postgresql_query](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_query_module.html)
140 - [postgresql_user](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_user_module.html)
141
142 - **Other modules**:
143 - [postgresql_copy](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_copy_module.html)
144 - [postgresql_idx](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_idx_module.html)
145 - [postgresql_membership](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_membership_module.html)
146 - [postgresql_owner](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_owner_module.html)
147 - [postgresql_publication](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_publication_module.html)
148 - [postgresql_sequence](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_sequence_module.html)
149 - [postgresql_slot](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_slot_module.html)
150 - [postgresql_subscription](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_subscription_module.html)
151 - [postgresql_table](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_table_module.html)
152
153 ## Using this collection
154
155 ### Installing the Collection from Ansible Galaxy
156
157 Before using the PostgreSQL collection, you need to install it with the Ansible Galaxy command-line tool:
158
159 ```bash
160 ansible-galaxy collection install community.postgresql
161 ```
162
163 You can include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml`, using the format:
164
165 ```yaml
166 ---
167 collections:
168 - name: community.postgresql
169 ```
170
171 You can also download the tarball from [Ansible Galaxy](https://galaxy.ansible.com/ui/repo/published/community/postgresql) and install the collection manually wherever you need.
172
173 Note that if you install the collection from Ansible Galaxy with the command-line tool or tarball, it will not be upgraded automatically when you upgrade the Ansible package. To upgrade the collection to the latest available version, run the following command:
174
175 ```bash
176 ansible-galaxy collection install community.postgresql --upgrade
177 ```
178
179 You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax:
180
181 ```bash
182 ansible-galaxy collection install community.postgresql:==X.Y.Z
183 ```
184
185 See [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details.
186
187 ## Release notes
188
189 See the [changelog](https://github.com/ansible-collections/community.postgresql/blob/main/CHANGELOG.rst).
190
191 ## More information
192
193 - [Ansible Collection overview](https://github.com/ansible-collections/overview)
194 - [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)
195 - [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)
196 - [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
197
198 ## Licensing
199
200 GNU General Public License v3.0 or later.
201
202 See [LICENSE](https://www.gnu.org/licenses/gpl-3.0.txt) to see the full text.