# postgresql\_privs module not setting priviledges on views \[bug?\]

**URL:** <https://forum.ansible.com/t/postgresql-privs-module-not-setting-priviledges-on-views-bug/20485>\
**Category:** Ansible Project\
**Created:** [February 8, 2016, 12:55pm UTC](https://forum.ansible.com/t/postgresql-privs-module-not-setting-priviledges-on-views-bug/20485 "2016-02-08T12:55:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcv21](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@mcv21](https://forum.ansible.com/u/mcv21)\
**Post date:** [February 8, 2016, 12:55pm UTC](https://forum.ansible.com/t/postgresql-privs-module-not-setting-priviledges-on-views-bug/20485/1 "2016-02-08T12:55:14Z")

</div>

Hi,

I have the following:

- name: grant SELECT privs to roles  
&nbsp;&nbsp;&nbsp;sudo: yes  
&nbsp;&nbsp;&nbsp;sudo\_user: postgres  
&nbsp;&nbsp;&nbsp;postgresql\_privs: db=raven type=table priv=SELECT objs=ALL\_IN\_SCHEMA  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;role={{item}}  
&nbsp;&nbsp;&nbsp;with\_items:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- ravenstaff  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- readonly

This fails to grant SELECT on views in the public schema, whereas:

GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly;

Does (and the postgres documentation says that it should do).

Is this a bug in the postgresql\_privs module?

Thanks,

Matthew
