Defined Type: postgresql::server::table_grant

Defined in:
manifests/server/table_grant.pp

Summary

This resource wraps the grant resource to manage table grants specifically.

Overview

Parameters:

  • privilege (Any)

    Specifies comma-separated list of privileges to grant. Valid options: ‘ALL’, ‘SELECT’, ‘INSERT’, ‘UPDATE’, ‘DELETE’, ‘TRUNCATE’, ‘REFERENCES’, ‘TRIGGER’.

  • table (Any)

    Specifies the table to which you are granting access.

  • db (Any)

    Specifies which database the table is in.

  • role (Any)

    Specifies the role or user to whom you are granting access.

  • ensure (Any) (defaults to: undef)

    Specifies whether to grant or revoke the privilege. Default is to grant the privilege.

  • port (Any) (defaults to: undef)

    Port to use when connecting.

  • psql_db (Any) (defaults to: undef)

    Specifies the database to execute the grant against. This should not ordinarily be changed from the default.

  • psql_user (Any) (defaults to: undef)

    Specifies the OS user for running psql.

  • connect_settings (Any) (defaults to: undef)

    Specifies a hash of environment variables used when connecting to a remote server.

  • onlyif_exists (Any) (defaults to: false)

    Create grant only if it doesn’t exist.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'manifests/server/table_grant.pp', line 13

define postgresql::server::table_grant (
  $privilege,
  $table,
  $db,
  $role,
  $ensure           = undef,
  $port             = undef,
  $psql_db          = undef,
  $psql_user        = undef,
  $connect_settings = undef,
  $onlyif_exists    = false,
) {
  postgresql::server::grant { "table:${name}":
    ensure           => $ensure,
    role             => $role,
    db               => $db,
    port             => $port,
    privilege        => $privilege,
    object_type      => 'TABLE',
    object_name      => $table,
    psql_db          => $psql_db,
    psql_user        => $psql_user,
    onlyif_exists    => $onlyif_exists,
    connect_settings => $connect_settings,
  }
}