Skip to content

Commit 460ebc7

Browse files
variables to parameters for tablespace/schema/reassign_owned_by
1 parent 1f1a28d commit 460ebc7

File tree

4 files changed

+137
-27
lines changed

4 files changed

+137
-27
lines changed

REFERENCE.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3279,6 +3279,8 @@ The following parameters are available in the `postgresql::server::reassign_owne
32793279
* [`psql_user`](#-postgresql--server--reassign_owned_by--psql_user)
32803280
* [`port`](#-postgresql--server--reassign_owned_by--port)
32813281
* [`connect_settings`](#-postgresql--server--reassign_owned_by--connect_settings)
3282+
* [`group`](#-postgresql--server--reassign_owned_by--group)
3283+
* [`psql_path`](#-postgresql--server--reassign_owned_by--psql_path)
32823284

32833285
##### <a name="-postgresql--server--reassign_owned_by--old_role"></a>`old_role`
32843286

@@ -3322,6 +3324,22 @@ Specifies a hash of environment variables used when connecting to a remote serve
33223324

33233325
Default value: `$postgresql::server::default_connect_settings`
33243326

3327+
##### <a name="-postgresql--server--reassign_owned_by--group"></a>`group`
3328+
3329+
Data type: `String[1]`
3330+
3331+
Sets the OS group to run psql
3332+
3333+
Default value: `$postgresql::server::group`
3334+
3335+
##### <a name="-postgresql--server--reassign_owned_by--psql_path"></a>`psql_path`
3336+
3337+
Data type: `Stdlib::Absolutepath`
3338+
3339+
Sets the path to psql command
3340+
3341+
Default value: `$postgresql::server::psql_path`
3342+
33253343
### <a name="postgresql--server--recovery"></a>`postgresql::server::recovery`
33263344

33273345
This resource manages the parameters that applies to the recovery.conf template.
@@ -3698,6 +3716,10 @@ The following parameters are available in the `postgresql::server::schema` defin
36983716
* [`schema`](#-postgresql--server--schema--schema)
36993717
* [`connect_settings`](#-postgresql--server--schema--connect_settings)
37003718
* [`port`](#-postgresql--server--schema--port)
3719+
* [`user`](#-postgresql--server--schema--user)
3720+
* [`group`](#-postgresql--server--schema--group)
3721+
* [`psql_path`](#-postgresql--server--schema--psql_path)
3722+
* [`module_workdir`](#-postgresql--server--schema--module_workdir)
37013723

37023724
##### <a name="-postgresql--server--schema--db"></a>`db`
37033725

@@ -3739,6 +3761,39 @@ the post the postgresql instance is listening on.
37393761

37403762
Default value: `$postgresql::server::port`
37413763

3764+
##### <a name="-postgresql--server--schema--user"></a>`user`
3765+
3766+
Data type: `String[1]`
3767+
3768+
Sets the OS user to run psql
3769+
3770+
Default value: `$postgresql::server::user`
3771+
3772+
##### <a name="-postgresql--server--schema--group"></a>`group`
3773+
3774+
Data type: `String[1]`
3775+
3776+
Sets the OS group to run psql
3777+
3778+
Default value: `$postgresql::server::group`
3779+
3780+
##### <a name="-postgresql--server--schema--psql_path"></a>`psql_path`
3781+
3782+
Data type: `Stdlib::Absolutepath`
3783+
3784+
Sets path to psql command
3785+
3786+
Default value: `$postgresql::server::psql_path`
3787+
3788+
##### <a name="-postgresql--server--schema--module_workdir"></a>`module_workdir`
3789+
3790+
Data type: `Stdlib::Absolutepath`
3791+
3792+
Specifies working directory under which the psql command should be executed.
3793+
May need to specify if '/tmp' is on volume mounted with noexec option.
3794+
3795+
Default value: `$postgresql::server::module_workdir`
3796+
37423797
### <a name="postgresql--server--table_grant"></a>`postgresql::server::table_grant`
37433798

37443799
This resource wraps the grant resource to manage table grants specifically.
@@ -3850,6 +3905,10 @@ The following parameters are available in the `postgresql::server::tablespace` d
38503905
* [`spcname`](#-postgresql--server--tablespace--spcname)
38513906
* [`connect_settings`](#-postgresql--server--tablespace--connect_settings)
38523907
* [`port`](#-postgresql--server--tablespace--port)
3908+
* [`user`](#-postgresql--server--tablespace--user)
3909+
* [`group`](#-postgresql--server--tablespace--group)
3910+
* [`psql_path`](#-postgresql--server--tablespace--psql_path)
3911+
* [`module_workdir`](#-postgresql--server--tablespace--module_workdir)
38533912

38543913
##### <a name="-postgresql--server--tablespace--location"></a>`location`
38553914

@@ -3897,6 +3956,39 @@ the port of the postgresql instance that sould be used.
38973956

38983957
Default value: `$postgresql::server::port`
38993958

3959+
##### <a name="-postgresql--server--tablespace--user"></a>`user`
3960+
3961+
Data type: `String[1]`
3962+
3963+
Sets the OS user to run psql
3964+
3965+
Default value: `$postgresql::server::user`
3966+
3967+
##### <a name="-postgresql--server--tablespace--group"></a>`group`
3968+
3969+
Data type: `String[1]`
3970+
3971+
Sets the OS group to run psql
3972+
3973+
Default value: `$postgresql::server::group`
3974+
3975+
##### <a name="-postgresql--server--tablespace--psql_path"></a>`psql_path`
3976+
3977+
Data type: `Stdlib::Absolutepath`
3978+
3979+
Sets path to psql command
3980+
3981+
Default value: `$postgresql::server::psql_path`
3982+
3983+
##### <a name="-postgresql--server--tablespace--module_workdir"></a>`module_workdir`
3984+
3985+
Data type: `String[1]`
3986+
3987+
Specifies working directory under which the psql command should be executed.
3988+
May need to specify if '/tmp' is on volume mounted with noexec option.
3989+
3990+
Default value: `$postgresql::server::module_workdir`
3991+
39003992
## Resource types
39013993

39023994
### <a name="postgresql_conf"></a>`postgresql_conf`
@@ -4062,6 +4154,7 @@ The following parameters are available in the `postgresql_psql` type.
40624154
* [`cwd`](#-postgresql_psql--cwd)
40634155
* [`db`](#-postgresql_psql--db)
40644156
* [`environment`](#-postgresql_psql--environment)
4157+
* [`instance`](#-postgresql_psql--instance)
40654158
* [`name`](#-postgresql_psql--name)
40664159
* [`onlyif`](#-postgresql_psql--onlyif)
40674160
* [`port`](#-postgresql_psql--port)
@@ -4094,6 +4187,12 @@ Any additional environment variables you want to set for a
40944187
SQL command. Multiple environment variables should be
40954188
specified as an array.
40964189

4190+
##### <a name="-postgresql_psql--instance"></a>`instance`
4191+
4192+
The postgresql instance under which the psql command should be executed.
4193+
4194+
Default value: `main`
4195+
40974196
##### <a name="-postgresql_psql--name"></a>`name`
40984197

40994198
namevar

manifests/server/reassign_owned_by.pp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@
88
# @param psql_user Specifies the OS user for running psql.
99
# @param port Port to use when connecting.
1010
# @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
11+
# @param group Sets the OS group to run psql
12+
# @param psql_path Sets the path to psql command
1113
define postgresql::server::reassign_owned_by (
1214
String $old_role,
1315
String $new_role,
1416
String $db,
15-
String $psql_user = $postgresql::server::user,
16-
Stdlib::Port $port = $postgresql::server::port,
17-
Hash $connect_settings = $postgresql::server::default_connect_settings,
17+
String $psql_user = $postgresql::server::user,
18+
Stdlib::Port $port = $postgresql::server::port,
19+
Hash $connect_settings = $postgresql::server::default_connect_settings,
20+
String[1] $group = $postgresql::server::group,
21+
Stdlib::Absolutepath $psql_path = $postgresql::server::psql_path,
1822
) {
1923
$sql_command = "REASSIGN OWNED BY \"${old_role}\" TO \"${new_role}\""
2024

21-
$group = $postgresql::server::group
22-
$psql_path = $postgresql::server::psql_path
23-
2425
$port_override = pick($connect_settings['PGPORT'], $port)
2526

2627
$onlyif = "SELECT tablename FROM pg_catalog.pg_tables WHERE

manifests/server/schema.pp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,27 @@
99
# @param schema Sets the name of the schema.
1010
# @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
1111
# @param port the post the postgresql instance is listening on.
12+
# @param user Sets the OS user to run psql
13+
# @param group Sets the OS group to run psql
14+
# @param psql_path Sets path to psql command
15+
# @param module_workdir
16+
# Specifies working directory under which the psql command should be executed.
17+
# May need to specify if '/tmp' is on volume mounted with noexec option.
1218
# @example
1319
# postgresql::server::schema {'private':
1420
# db => 'template1',
1521
# }
1622
define postgresql::server::schema (
17-
String[1] $db = $postgresql::server::default_database,
18-
Optional[String[1]] $owner = undef,
19-
String[1] $schema = $title,
20-
Hash $connect_settings = $postgresql::server::default_connect_settings,
21-
Stdlib::Port $port = $postgresql::server::port,
23+
String[1] $db = $postgresql::server::default_database,
24+
Optional[String[1]] $owner = undef,
25+
String[1] $schema = $title,
26+
Hash $connect_settings = $postgresql::server::default_connect_settings,
27+
Stdlib::Port $port = $postgresql::server::port,
28+
String[1] $user = $postgresql::server::user,
29+
String[1] $group = $postgresql::server::group,
30+
Stdlib::Absolutepath $psql_path = $postgresql::server::psql_path,
31+
Stdlib::Absolutepath $module_workdir = $postgresql::server::module_workdir,
2232
) {
23-
$user = $postgresql::server::user
24-
$group = $postgresql::server::group
25-
$psql_path = $postgresql::server::psql_path
26-
$module_workdir = $postgresql::server::module_workdir
27-
2833
Postgresql::Server::Db <| dbname == $db |> -> Postgresql::Server::Schema[$name]
2934

3035
# If the connection settings do not contain a port, then use the local server port

manifests/server/tablespace.pp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@
66
# @param spcname Specifies the name of the tablespace.
77
# @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
88
# @param port the port of the postgresql instance that sould be used.
9+
# @param user Sets the OS user to run psql
10+
# @param group Sets the OS group to run psql
11+
# @param psql_path Sets path to psql command
12+
# @param module_workdir
13+
# Specifies working directory under which the psql command should be executed.
14+
# May need to specify if '/tmp' is on volume mounted with noexec option.
915
define postgresql::server::tablespace (
10-
String[1] $location,
11-
Boolean $manage_location = true,
12-
Optional[String[1]] $owner = undef,
13-
String[1] $spcname = $title,
14-
Hash $connect_settings = $postgresql::server::default_connect_settings,
15-
Stdlib::Port $port = $postgresql::server::port,
16+
String[1] $location,
17+
Boolean $manage_location = true,
18+
Optional[String[1]] $owner = undef,
19+
String[1] $spcname = $title,
20+
Hash $connect_settings = $postgresql::server::default_connect_settings,
21+
Stdlib::Port $port = $postgresql::server::port,
22+
String[1] $user = $postgresql::server::user,
23+
String[1] $group = $postgresql::server::group,
24+
Stdlib::Absolutepath $psql_path = $postgresql::server::psql_path,
25+
String[1] $module_workdir = $postgresql::server::module_workdir,
1626
) {
17-
$user = $postgresql::server::user
18-
$group = $postgresql::server::group
19-
$psql_path = $postgresql::server::psql_path
20-
$module_workdir = $postgresql::server::module_workdir
21-
2227
# If the connection settings do not contain a port, then use the local server port
2328
$port_override = pick($connect_settings['PGPORT'], $port)
2429

0 commit comments

Comments
 (0)