The postgres_privileges module is used to manage Postgres privileges. Privileges can be set as either absent or present.
Privileges can be set on the following database object types:
Setting the grant option is supported as well.
2016.3.0 新版功能.
baruwa:
postgres_privileges.present:
- object_name: awl
- object_type: table
- privileges:
- SELECT
- INSERT
- DELETE
- grant_option: False
- prepend: public
- maintenance_db: testdb
andrew:
postgres_privileges.present:
- object_name: admins
- object_type: group
- grant_option: False
- maintenance_db: testdb
baruwa:
postgres_privileges.absent:
- object_name: awl
- object_type: table
- privileges:
- SELECT
- INSERT
- DELETE
- prepend: public
- maintenance_db: testdb
andrew:
postgres_privileges.absent:
- object_name: admins
- object_type: group
- maintenance_db: testdb
salt.states.postgres_privileges.
absent
(name, object_name, object_type, privileges=None, prepend='public', maintenance_db=None, user=None, db_password=None, db_host=None, db_port=None, db_user=None)¶Revoke the requested privilege(s) on the specificed object(s)
The object type, which can be one of the following:
Comma separated list of privilages to revoke, from the list below:
note: | privileges should not be set when revoking group membership |
---|
salt.states.postgres_privileges.
present
(name, object_name, object_type, privileges=None, grant_option=None, prepend='public', maintenance_db=None, user=None, db_password=None, db_host=None, db_port=None, db_user=None)¶Grant the requested privilege(s) on the specified object to a role
The object type, which can be one of the following:
Comma separated list of privilages to grant, from the list below:
note: | privileges should not be set when granting group membership |
---|