From 9d66640bcf3111f6692f2a87205cd1d974e4e14c Mon Sep 17 00:00:00 2001 From: nightcityblade Date: Thu, 9 Jul 2026 23:11:52 +0800 Subject: [PATCH] fix: declare the community.postgresql requirement --- README.md | 4 ++++ tasks/databases.yml | 2 +- tasks/users.yml | 2 +- tasks/users_props.yml | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0c7cf285..c125c623 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ No special requirements; note that this role requires root access, so either run - role: geerlingguy.postgresql become: yes ``` + +If you are running this role with `ansible-core`, install the +`community.postgresql` collection first so the PostgreSQL modules used by the +role are available. ## Role Variables Available variables are listed below, along with default values (see `defaults/main.yml`): diff --git a/tasks/databases.yml b/tasks/databases.yml index e01d804d..26a66a66 100644 --- a/tasks/databases.yml +++ b/tasks/databases.yml @@ -1,6 +1,6 @@ --- - name: Ensure PostgreSQL databases are present. - postgresql_db: + community.postgresql.postgresql_db: name: "{{ item.name }}" lc_collate: "{{ item.lc_collate | default('en_US.UTF-8') }}" lc_ctype: "{{ item.lc_ctype | default('en_US.UTF-8') }}" diff --git a/tasks/users.yml b/tasks/users.yml index 6cbae015..80b6dedb 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -1,6 +1,6 @@ --- - name: Ensure PostgreSQL users are present. - postgresql_user: + community.postgresql.postgresql_user: name: "{{ item.name }}" password: "{{ item.password | default(omit) }}" login_host: "{{ item.login_host | default('localhost') }}" diff --git a/tasks/users_props.yml b/tasks/users_props.yml index 5baf6e5f..716e157c 100644 --- a/tasks/users_props.yml +++ b/tasks/users_props.yml @@ -1,6 +1,6 @@ --- - name: Ensure PostgreSQL users are configured correctly. - postgresql_user: + community.postgresql.postgresql_user: name: "{{ item.name }}" password: "{{ item.password | default(omit) }}" encrypted: "{{ item.encrypted | default(omit) }}" @@ -32,7 +32,7 @@ when: item.priv is defined - name: Ensure PostgreSQL users privileges are configured correctly. - postgresql_privs: + community.postgresql.postgresql_privs: roles: "{{ item.roles }}" db: "{{ item.db }}" privs: "{{ item.privs | default(omit) }}"