Skip to content

Commit 32114e1

Browse files
authored
Merge pull request #1496 from bastelfreak/server_grant
server::grant: Prefer $connect_settings over default port
2 parents 081e009 + 4304290 commit 32114e1

File tree

2 files changed

+29
-181
lines changed

2 files changed

+29
-181
lines changed

REFERENCE.md

Lines changed: 26 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
* [`postgresql::server::db`](#postgresql--server--db): Define for conveniently creating a role, database and assigning the correctpermissions.
4848
* [`postgresql::server::default_privileges`](#postgresql--server--default_privileges): Manage a database defaults privileges. Only works with PostgreSQL version 9.6 and above.
4949
* [`postgresql::server::extension`](#postgresql--server--extension): Activate an extension on a postgresql database.
50-
* [`postgresql::server::grant`](#postgresql--server--grant): Define for granting permissions to roles.
5150
* [`postgresql::server::grant_role`](#postgresql--server--grant_role): Define for granting membership to a role.
5251
* [`postgresql::server::instance::config`](#postgresql--server--instance--config): Manages the config for a postgresql::server instance
5352
* [`postgresql::server::instance::initdb`](#postgresql--server--instance--initdb): Manages initdb feature for a postgresql::server instance
@@ -348,39 +347,39 @@ Default value: `undef`
348347

349348
##### <a name="-postgresql--globals--initdb_path"></a>`initdb_path`
350349

351-
Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]`
350+
Data type: `Optional[Stdlib::Absolutepath]`
352351

353352
Path to the initdb command.
354353

355354
Default value: `undef`
356355

357356
##### <a name="-postgresql--globals--psql_path"></a>`psql_path`
358357

359-
Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]`
358+
Data type: `Optional[Stdlib::Absolutepath]`
360359

361360
Sets the path to the psql command.
362361

363362
Default value: `undef`
364363

365364
##### <a name="-postgresql--globals--pg_hba_conf_path"></a>`pg_hba_conf_path`
366365

367-
Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]`
366+
Data type: `Optional[Stdlib::Absolutepath]`
368367

369368
Specifies the path to your pg_hba.conf file.
370369

371370
Default value: `undef`
372371

373372
##### <a name="-postgresql--globals--pg_ident_conf_path"></a>`pg_ident_conf_path`
374373

375-
Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]`
374+
Data type: `Optional[Stdlib::Absolutepath]`
376375

377376
Specifies the path to your pg_ident.conf file.
378377

379378
Default value: `undef`
380379

381380
##### <a name="-postgresql--globals--postgresql_conf_path"></a>`postgresql_conf_path`
382381

383-
Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]`
382+
Data type: `Optional[Stdlib::Absolutepath]`
384383

385384
Sets the path to your postgresql.conf file.
386385

@@ -396,7 +395,7 @@ Default value: `undef`
396395

397396
##### <a name="-postgresql--globals--recovery_conf_path"></a>`recovery_conf_path`
398397

399-
Data type: `Optional[Variant[String[1], Stdlib::Absolutepath]]`
398+
Data type: `Optional[Stdlib::Absolutepath]`
400399

401400
Path to your recovery.conf file.
402401

@@ -1068,39 +1067,39 @@ Default value: `$postgresql::params::ipv6acls`
10681067

10691068
##### <a name="-postgresql--server--initdb_path"></a>`initdb_path`
10701069

1071-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
1070+
Data type: `Stdlib::Absolutepath`
10721071

10731072
Specifies the path to the initdb command.
10741073

10751074
Default value: `$postgresql::params::initdb_path`
10761075

10771076
##### <a name="-postgresql--server--psql_path"></a>`psql_path`
10781077

1079-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
1078+
Data type: `Stdlib::Absolutepath`
10801079

10811080
Specifies the path to the psql command.
10821081

10831082
Default value: `$postgresql::params::psql_path`
10841083

10851084
##### <a name="-postgresql--server--pg_hba_conf_path"></a>`pg_hba_conf_path`
10861085

1087-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
1086+
Data type: `Stdlib::Absolutepath`
10881087

10891088
Specifies the path to your pg_hba.conf file.
10901089

10911090
Default value: `$postgresql::params::pg_hba_conf_path`
10921091

10931092
##### <a name="-postgresql--server--pg_ident_conf_path"></a>`pg_ident_conf_path`
10941093

1095-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
1094+
Data type: `Stdlib::Absolutepath`
10961095

10971096
Specifies the path to your pg_ident.conf file.
10981097

10991098
Default value: `$postgresql::params::pg_ident_conf_path`
11001099

11011100
##### <a name="-postgresql--server--postgresql_conf_path"></a>`postgresql_conf_path`
11021101

1103-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
1102+
Data type: `Stdlib::Absolutepath`
11041103

11051104
Specifies the path to your postgresql.conf file.
11061105

@@ -1116,7 +1115,7 @@ Default value: `$postgresql::params::postgresql_conf_mode`
11161115

11171116
##### <a name="-postgresql--server--recovery_conf_path"></a>`recovery_conf_path`
11181117

1119-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
1118+
Data type: `Stdlib::Absolutepath`
11201119

11211120
Specifies the path to your recovery.conf file.
11221121

@@ -1543,11 +1542,11 @@ Default value: `undef`
15431542

15441543
##### <a name="-postgresql--server--config_entry--path"></a>`path`
15451544

1546-
Data type: `Variant[Boolean, String[1]]`
1545+
Data type: `Stdlib::Absolutepath`
15471546

15481547
Path for postgresql.conf
15491548

1550-
Default value: `false`
1549+
Default value: `$postgresql::server::postgresql_conf_path`
15511550

15521551
### <a name="postgresql--server--database"></a>`postgresql::server::database`
15531552

@@ -1910,7 +1909,7 @@ Default value: `$postgresql::server::user`
19101909

19111910
##### <a name="-postgresql--server--default_privileges--psql_path"></a>`psql_path`
19121911

1913-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
1912+
Data type: `Stdlib::Absolutepath`
19141913

19151914
Specifies the OS user for running psql. Default value: The default user for the module, usually 'postgres'.
19161915

@@ -2045,157 +2044,6 @@ Specifies the resource name of the DB being managed. Defaults to the parameter $
20452044

20462045
Default value: `$database`
20472046

2048-
### <a name="postgresql--server--grant"></a>`postgresql::server::grant`
2049-
2050-
Define for granting permissions to roles.
2051-
2052-
#### Parameters
2053-
2054-
The following parameters are available in the `postgresql::server::grant` defined type:
2055-
2056-
* [`role`](#-postgresql--server--grant--role)
2057-
* [`db`](#-postgresql--server--grant--db)
2058-
* [`privilege`](#-postgresql--server--grant--privilege)
2059-
* [`object_type`](#-postgresql--server--grant--object_type)
2060-
* [`object_name`](#-postgresql--server--grant--object_name)
2061-
* [`object_arguments`](#-postgresql--server--grant--object_arguments)
2062-
* [`psql_db`](#-postgresql--server--grant--psql_db)
2063-
* [`psql_user`](#-postgresql--server--grant--psql_user)
2064-
* [`port`](#-postgresql--server--grant--port)
2065-
* [`onlyif_exists`](#-postgresql--server--grant--onlyif_exists)
2066-
* [`connect_settings`](#-postgresql--server--grant--connect_settings)
2067-
* [`ensure`](#-postgresql--server--grant--ensure)
2068-
* [`group`](#-postgresql--server--grant--group)
2069-
* [`psql_path`](#-postgresql--server--grant--psql_path)
2070-
2071-
##### <a name="-postgresql--server--grant--role"></a>`role`
2072-
2073-
Data type: `String`
2074-
2075-
Specifies the role or user whom you are granting access to.
2076-
2077-
##### <a name="-postgresql--server--grant--db"></a>`db`
2078-
2079-
Data type: `String`
2080-
2081-
Specifies the database to which you are granting access.
2082-
2083-
##### <a name="-postgresql--server--grant--privilege"></a>`privilege`
2084-
2085-
Data type: `String`
2086-
2087-
Specifies the privilege to grant. Valid options: 'ALL', 'ALL PRIVILEGES' or 'object_type' dependent string.
2088-
2089-
Default value: `''`
2090-
2091-
##### <a name="-postgresql--server--grant--object_type"></a>`object_type`
2092-
2093-
Data type:
2094-
2095-
```puppet
2096-
Pattern[#/(?i:^COLUMN$)/,
2097-
/(?i:^ALL SEQUENCES IN SCHEMA$)/,
2098-
/(?i:^ALL TABLES IN SCHEMA$)/,
2099-
/(?i:^DATABASE$)/,
2100-
#/(?i:^FOREIGN DATA WRAPPER$)/,
2101-
#/(?i:^FOREIGN SERVER$)/,
2102-
/(?i:^FUNCTION$)/,
2103-
/(?i:^LANGUAGE$)/,
2104-
#/(?i:^PROCEDURAL LANGUAGE$)/,
2105-
/(?i:^TABLE$)/,
2106-
#/(?i:^TABLESPACE$)/,
2107-
/(?i:^SCHEMA$)/,
2108-
/(?i:^SEQUENCE$)/
2109-
#/(?i:^VIEW$)/
2110-
]
2111-
```
2112-
2113-
Specifies the type of object to which you are granting privileges.
2114-
Valid options: 'DATABASE', 'SCHEMA', 'SEQUENCE', 'ALL SEQUENCES IN SCHEMA', 'TABLE' or 'ALL TABLES IN SCHEMA'.
2115-
2116-
Default value: `'database'`
2117-
2118-
##### <a name="-postgresql--server--grant--object_name"></a>`object_name`
2119-
2120-
Data type: `Optional[Variant[Array[String,2,2],String[1]]]`
2121-
2122-
Specifies name of object_type to which to grant access, can be either a string or a two element array.
2123-
String: 'object_name' Array: ['schema_name', 'object_name']
2124-
2125-
Default value: `undef`
2126-
2127-
##### <a name="-postgresql--server--grant--object_arguments"></a>`object_arguments`
2128-
2129-
Data type: `Array[String[1],0]`
2130-
2131-
Specifies any arguments to be passed alongisde the access grant.
2132-
2133-
Default value: `[]`
2134-
2135-
##### <a name="-postgresql--server--grant--psql_db"></a>`psql_db`
2136-
2137-
Data type: `String`
2138-
2139-
Specifies the database to execute the grant against. This should not ordinarily be changed from the default
2140-
2141-
Default value: `$postgresql::server::default_database`
2142-
2143-
##### <a name="-postgresql--server--grant--psql_user"></a>`psql_user`
2144-
2145-
Data type: `String`
2146-
2147-
Sets the OS user to run psql.
2148-
2149-
Default value: `$postgresql::server::user`
2150-
2151-
##### <a name="-postgresql--server--grant--port"></a>`port`
2152-
2153-
Data type: `Stdlib::Port`
2154-
2155-
Port to use when connecting.
2156-
2157-
Default value: `$postgresql::server::port`
2158-
2159-
##### <a name="-postgresql--server--grant--onlyif_exists"></a>`onlyif_exists`
2160-
2161-
Data type: `Boolean`
2162-
2163-
Create grant only if doesn't exist
2164-
2165-
Default value: `false`
2166-
2167-
##### <a name="-postgresql--server--grant--connect_settings"></a>`connect_settings`
2168-
2169-
Data type: `Hash`
2170-
2171-
Specifies a hash of environment variables used when connecting to a remote server.
2172-
2173-
Default value: `$postgresql::server::default_connect_settings`
2174-
2175-
##### <a name="-postgresql--server--grant--ensure"></a>`ensure`
2176-
2177-
Data type: `Enum['present', 'absent']`
2178-
2179-
Specifies whether to grant or revoke the privilege. Default is to grant the privilege. Valid values: 'present', 'absent'.
2180-
2181-
Default value: `'present'`
2182-
2183-
##### <a name="-postgresql--server--grant--group"></a>`group`
2184-
2185-
Data type: `String`
2186-
2187-
Sets the OS group to run psql
2188-
2189-
Default value: `$postgresql::server::group`
2190-
2191-
##### <a name="-postgresql--server--grant--psql_path"></a>`psql_path`
2192-
2193-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2194-
2195-
Sets the path to psql command
2196-
2197-
Default value: `$postgresql::server::psql_path`
2198-
21992047
### <a name="postgresql--server--grant_role"></a>`postgresql::server::grant_role`
22002048

22012049
Define for granting membership to a role.
@@ -2360,23 +2208,23 @@ Default value: `$postgresql::server::ipv6acls`
23602208

23612209
##### <a name="-postgresql--server--instance--config--pg_hba_conf_path"></a>`pg_hba_conf_path`
23622210

2363-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2211+
Data type: `Stdlib::Absolutepath`
23642212

23652213
Specifies the path to your pg_hba.conf file.
23662214

23672215
Default value: `$postgresql::server::pg_hba_conf_path`
23682216

23692217
##### <a name="-postgresql--server--instance--config--pg_ident_conf_path"></a>`pg_ident_conf_path`
23702218

2371-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2219+
Data type: `Stdlib::Absolutepath`
23722220

23732221
Specifies the path to your pg_ident.conf file.
23742222

23752223
Default value: `$postgresql::server::pg_ident_conf_path`
23762224

23772225
##### <a name="-postgresql--server--instance--config--postgresql_conf_path"></a>`postgresql_conf_path`
23782226

2379-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2227+
Data type: `Stdlib::Absolutepath`
23802228

23812229
Specifies the path to your postgresql.conf file.
23822230

@@ -2392,7 +2240,7 @@ Default value: `$postgresql::server::postgresql_conf_mode`
23922240

23932241
##### <a name="-postgresql--server--instance--config--recovery_conf_path"></a>`recovery_conf_path`
23942242

2395-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2243+
Data type: `Stdlib::Absolutepath`
23962244

23972245
Specifies the path to your recovery.conf file.
23982246

@@ -2609,7 +2457,7 @@ Default value: `$postgresql::server::group`
26092457

26102458
##### <a name="-postgresql--server--instance--initdb--initdb_path"></a>`initdb_path`
26112459

2612-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2460+
Data type: `Stdlib::Absolutepath`
26132461

26142462
Specifies the path to the initdb command.
26152463

@@ -2749,7 +2597,7 @@ Default value: `$postgresql::server::group`
27492597

27502598
##### <a name="-postgresql--server--instance--late_initdb--psql_path"></a>`psql_path`
27512599

2752-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2600+
Data type: `Stdlib::Absolutepath`
27532601

27542602
Specifies the path to the psql command.
27552603

@@ -2808,7 +2656,7 @@ Default value: `$postgresql::server::group`
28082656

28092657
##### <a name="-postgresql--server--instance--passwd--psql_path"></a>`psql_path`
28102658

2811-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2659+
Data type: `Stdlib::Absolutepath`
28122660

28132661
Specifies the path to the psql command.
28142662

@@ -2973,7 +2821,7 @@ Default value: `$postgresql::server::default_database`
29732821

29742822
##### <a name="-postgresql--server--instance--service--psql_path"></a>`psql_path`
29752823

2976-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2824+
Data type: `Stdlib::Absolutepath`
29772825

29782826
Specifies the path to the psql command.
29792827

@@ -3140,7 +2988,7 @@ Default value: `'150'`
31402988

31412989
##### <a name="-postgresql--server--pg_ident_rule--target"></a>`target`
31422990

3143-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
2991+
Data type: `Stdlib::Absolutepath`
31442992

31452993
Provides the target for the rule and is generally an internal only property. Use with caution.
31462994

@@ -3360,7 +3208,7 @@ Default value: `undef`
33603208

33613209
##### <a name="-postgresql--server--recovery--target"></a>`target`
33623210

3363-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
3211+
Data type: `Stdlib::Absolutepath`
33643212

33653213
Provides the target for the rule, and is generally an internal only property. Use with caution.
33663214

@@ -3525,7 +3373,7 @@ Default value: `$postgresql::server::group`
35253373

35263374
##### <a name="-postgresql--server--role--psql_path"></a>`psql_path`
35273375

3528-
Data type: `Variant[String[1], Stdlib::Absolutepath]`
3376+
Data type: `Stdlib::Absolutepath`
35293377

35303378
Sets path to psql command
35313379

0 commit comments

Comments
 (0)