Skip to content

Cannot grant select on tables in all schemas with postgresql_privs #333

@caseyandgina

Description

@caseyandgina
SUMMARY

I want to alter default permissions to grant select on all tables in all schemas, using community.postgresql.postgresql_privs, but this does not seem to be possible as it defaults to public schema only.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.postgresql.postgresql_privs

ANSIBLE VERSION
ansible [core 2.12.5]
  config file = /home/ubuntu/worktrees/casey_patroni_fixups/ansible/ansible.cfg
  configured module search path = ['/home/ubuntu/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /home/ubuntu/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 2.10.1
  libyaml = True
COLLECTION VERSION
# /usr/local/lib/python3.8/dist-packages/ansible_collections
Collection           Version
-------------------- -------
community.postgresql 1.6.0  

CONFIGURATION

OS / ENVIRONMENT

Ubuntu 20.04

STEPS TO REPRODUCE
- name: Grant datascience usage to all tables in test database
  community.postgresql.postgresql_privs:
    database: test
    type: default_privs
    privs: select
    objs: tables
    role: datascience
    target_roles: test
    usage_on_types: no
EXPECTED RESULTS
test=# \ddp
           Default access privileges
 Owner | Schema |  Type  |  Access privileges  
-------+--------+--------+---------------------
 truth |        | table  | datascience=r/test
ACTUAL RESULTS
test=# \ddp
           Default access privileges
 Owner | Schema |  Type  |  Access privileges  
-------+--------+--------+---------------------
 truth | public | table  | datascience=r/test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions