diff --git a/REFERENCE.md b/REFERENCE.md index ab1b6fea54..770f3ada84 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -47,7 +47,6 @@ * [`postgresql::server::db`](#postgresql--server--db): Define for conveniently creating a role, database and assigning the correctpermissions. * [`postgresql::server::default_privileges`](#postgresql--server--default_privileges): Manage a database defaults privileges. Only works with PostgreSQL version 9.6 and above. * [`postgresql::server::extension`](#postgresql--server--extension): Activate an extension on a postgresql database. -* [`postgresql::server::grant`](#postgresql--server--grant): Define for granting permissions to roles. * [`postgresql::server::grant_role`](#postgresql--server--grant_role): Define for granting membership to a role. * [`postgresql::server::instance::config`](#postgresql--server--instance--config): Manages the config for a postgresql::server instance * [`postgresql::server::instance::initdb`](#postgresql--server--instance--initdb): Manages initdb feature for a postgresql::server instance @@ -348,7 +347,7 @@ Default value: `undef` ##### `initdb_path` -Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]` +Data type: `Optional[Stdlib::Absolutepath]` Path to the initdb command. @@ -356,7 +355,7 @@ Default value: `undef` ##### `psql_path` -Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]` +Data type: `Optional[Stdlib::Absolutepath]` Sets the path to the psql command. @@ -364,7 +363,7 @@ Default value: `undef` ##### `pg_hba_conf_path` -Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]` +Data type: `Optional[Stdlib::Absolutepath]` Specifies the path to your pg_hba.conf file. @@ -372,7 +371,7 @@ Default value: `undef` ##### `pg_ident_conf_path` -Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]` +Data type: `Optional[Stdlib::Absolutepath]` Specifies the path to your pg_ident.conf file. @@ -380,7 +379,7 @@ Default value: `undef` ##### `postgresql_conf_path` -Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]` +Data type: `Optional[Stdlib::Absolutepath]` Sets the path to your postgresql.conf file. @@ -396,7 +395,7 @@ Default value: `undef` ##### `recovery_conf_path` -Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]` +Data type: `Optional[Stdlib::Absolutepath]` Path to your recovery.conf file. @@ -1068,7 +1067,7 @@ Default value: `$postgresql::params::ipv6acls` ##### `initdb_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to the initdb command. @@ -1076,7 +1075,7 @@ Default value: `$postgresql::params::initdb_path` ##### `psql_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to the psql command. @@ -1084,7 +1083,7 @@ Default value: `$postgresql::params::psql_path` ##### `pg_hba_conf_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to your pg_hba.conf file. @@ -1092,7 +1091,7 @@ Default value: `$postgresql::params::pg_hba_conf_path` ##### `pg_ident_conf_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to your pg_ident.conf file. @@ -1100,7 +1099,7 @@ Default value: `$postgresql::params::pg_ident_conf_path` ##### `postgresql_conf_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to your postgresql.conf file. @@ -1116,7 +1115,7 @@ Default value: `$postgresql::params::postgresql_conf_mode` ##### `recovery_conf_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to your recovery.conf file. @@ -1543,11 +1542,11 @@ Default value: `undef` ##### `path` -Data type: `Variant[Boolean, String[1]]` +Data type: `Stdlib::Absolutepath` Path for postgresql.conf -Default value: `false` +Default value: `$postgresql::server::postgresql_conf_path` ### `postgresql::server::database` @@ -1910,7 +1909,7 @@ Default value: `$postgresql::server::user` ##### `psql_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the OS user for running psql. Default value: The default user for the module, usually 'postgres'. @@ -2045,157 +2044,6 @@ Specifies the resource name of the DB being managed. Defaults to the parameter $ Default value: `$database` -### `postgresql::server::grant` - -Define for granting permissions to roles. - -#### Parameters - -The following parameters are available in the `postgresql::server::grant` defined type: - -* [`role`](#-postgresql--server--grant--role) -* [`db`](#-postgresql--server--grant--db) -* [`privilege`](#-postgresql--server--grant--privilege) -* [`object_type`](#-postgresql--server--grant--object_type) -* [`object_name`](#-postgresql--server--grant--object_name) -* [`object_arguments`](#-postgresql--server--grant--object_arguments) -* [`psql_db`](#-postgresql--server--grant--psql_db) -* [`psql_user`](#-postgresql--server--grant--psql_user) -* [`port`](#-postgresql--server--grant--port) -* [`onlyif_exists`](#-postgresql--server--grant--onlyif_exists) -* [`connect_settings`](#-postgresql--server--grant--connect_settings) -* [`ensure`](#-postgresql--server--grant--ensure) -* [`group`](#-postgresql--server--grant--group) -* [`psql_path`](#-postgresql--server--grant--psql_path) - -##### `role` - -Data type: `String` - -Specifies the role or user whom you are granting access to. - -##### `db` - -Data type: `String` - -Specifies the database to which you are granting access. - -##### `privilege` - -Data type: `String` - -Specifies the privilege to grant. Valid options: 'ALL', 'ALL PRIVILEGES' or 'object_type' dependent string. - -Default value: `''` - -##### `object_type` - -Data type: - -```puppet -Pattern[#/(?i:^COLUMN$)/, - /(?i:^ALL SEQUENCES IN SCHEMA$)/, - /(?i:^ALL TABLES IN SCHEMA$)/, - /(?i:^DATABASE$)/, - #/(?i:^FOREIGN DATA WRAPPER$)/, - #/(?i:^FOREIGN SERVER$)/, - /(?i:^FUNCTION$)/, - /(?i:^LANGUAGE$)/, - #/(?i:^PROCEDURAL LANGUAGE$)/, - /(?i:^TABLE$)/, - #/(?i:^TABLESPACE$)/, - /(?i:^SCHEMA$)/, - /(?i:^SEQUENCE$)/ - #/(?i:^VIEW$)/ - ] -``` - -Specifies the type of object to which you are granting privileges. -Valid options: 'DATABASE', 'SCHEMA', 'SEQUENCE', 'ALL SEQUENCES IN SCHEMA', 'TABLE' or 'ALL TABLES IN SCHEMA'. - -Default value: `'database'` - -##### `object_name` - -Data type: `Optional[Variant[Array[String,2,2],String[1]]]` - -Specifies name of object_type to which to grant access, can be either a string or a two element array. -String: 'object_name' Array: ['schema_name', 'object_name'] - -Default value: `undef` - -##### `object_arguments` - -Data type: `Array[String[1],0]` - -Specifies any arguments to be passed alongisde the access grant. - -Default value: `[]` - -##### `psql_db` - -Data type: `String` - -Specifies the database to execute the grant against. This should not ordinarily be changed from the default - -Default value: `$postgresql::server::default_database` - -##### `psql_user` - -Data type: `String` - -Sets the OS user to run psql. - -Default value: `$postgresql::server::user` - -##### `port` - -Data type: `Stdlib::Port` - -Port to use when connecting. - -Default value: `$postgresql::server::port` - -##### `onlyif_exists` - -Data type: `Boolean` - -Create grant only if doesn't exist - -Default value: `false` - -##### `connect_settings` - -Data type: `Hash` - -Specifies a hash of environment variables used when connecting to a remote server. - -Default value: `$postgresql::server::default_connect_settings` - -##### `ensure` - -Data type: `Enum['present', 'absent']` - -Specifies whether to grant or revoke the privilege. Default is to grant the privilege. Valid values: 'present', 'absent'. - -Default value: `'present'` - -##### `group` - -Data type: `String` - -Sets the OS group to run psql - -Default value: `$postgresql::server::group` - -##### `psql_path` - -Data type: `Variant[String[1], Stdlib::Absolutepath]` - -Sets the path to psql command - -Default value: `$postgresql::server::psql_path` - ### `postgresql::server::grant_role` Define for granting membership to a role. @@ -2360,7 +2208,7 @@ Default value: `$postgresql::server::ipv6acls` ##### `pg_hba_conf_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to your pg_hba.conf file. @@ -2368,7 +2216,7 @@ Default value: `$postgresql::server::pg_hba_conf_path` ##### `pg_ident_conf_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to your pg_ident.conf file. @@ -2376,7 +2224,7 @@ Default value: `$postgresql::server::pg_ident_conf_path` ##### `postgresql_conf_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to your postgresql.conf file. @@ -2392,7 +2240,7 @@ Default value: `$postgresql::server::postgresql_conf_mode` ##### `recovery_conf_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to your recovery.conf file. @@ -2609,7 +2457,7 @@ Default value: `$postgresql::server::group` ##### `initdb_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to the initdb command. @@ -2749,7 +2597,7 @@ Default value: `$postgresql::server::group` ##### `psql_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to the psql command. @@ -2808,7 +2656,7 @@ Default value: `$postgresql::server::group` ##### `psql_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to the psql command. @@ -2973,7 +2821,7 @@ Default value: `$postgresql::server::default_database` ##### `psql_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Specifies the path to the psql command. @@ -3140,7 +2988,7 @@ Default value: `'150'` ##### `target` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Provides the target for the rule and is generally an internal only property. Use with caution. @@ -3360,7 +3208,7 @@ Default value: `undef` ##### `target` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Provides the target for the rule, and is generally an internal only property. Use with caution. @@ -3525,7 +3373,7 @@ Default value: `$postgresql::server::group` ##### `psql_path` -Data type: `Variant[String[1], Stdlib::Absolutepath]` +Data type: `Stdlib::Absolutepath` Sets path to psql command diff --git a/manifests/server/grant.pp b/manifests/server/grant.pp index 2a23b1b891..fe1e9bf596 100644 --- a/manifests/server/grant.pp +++ b/manifests/server/grant.pp @@ -41,7 +41,7 @@ Array[String[1],0] $object_arguments = [], String $psql_db = $postgresql::server::default_database, String $psql_user = $postgresql::server::user, - Stdlib::Port $port = $postgresql::server::port, + Optional[Stdlib::Port] $port = undef, Boolean $onlyif_exists = false, Hash $connect_settings = $postgresql::server::default_connect_settings, Enum['present', 'absent'] $ensure = 'present', @@ -76,10 +76,10 @@ # # Port, order of precedence: $port parameter, $connect_settings[PGPORT], $postgresql::server::port - # + # We don't use pick() here because that would introduce a hard dependency to the postgresql::server class if $port { $port_override = $port - } elsif $connect_settings != undef and 'PGPORT' in $connect_settings { + } elsif 'PGPORT' in $connect_settings { $port_override = undef } else { $port_override = $postgresql::server::port