Skip to content

Commit

Permalink
Fix #46 (SUP-2384) (#47)
Browse files Browse the repository at this point in the history
* Fix #46

#46

* static variables for paths with defaults

* Update manifests/exporter.pp

Co-authored-by: Dylan <dylan.ratcliffe@puppet.com>

Co-authored-by: Dylan <dylan.ratcliffe@puppet.com>
  • Loading branch information
MartyEwings and Dylan committed Apr 27, 2021
1 parent ec6dbd2 commit 050cbc4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
27 changes: 27 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ The following parameters are available in the `rsan::exporter` class:

* [`rsan_importer_ips`](#rsan_importer_ips)
* [`rsan_host`](#rsan_host)
* [`pg_user`](#pg_user)
* [`pg_group`](#pg_group)
* [`pg_psql_path`](#pg_psql_path)

##### <a name="rsan_importer_ips"></a>`rsan_importer_ips`

Expand All @@ -62,6 +65,30 @@ The certname of the rsan node

Default value: ``undef``

##### <a name="pg_user"></a>`pg_user`

Data type: `Optional[String]`

The postgres user PE uses

Default value: `'pe-postgres'`

##### <a name="pg_group"></a>`pg_group`

Data type: `Optional[String]`

The postgres group PE uses the default is pg_user

Default value: `$pg_user`

##### <a name="pg_psql_path"></a>`pg_psql_path`

Data type: `Optional[String]`

The path to the postgres binary in pe

Default value: `'/opt/puppetlabs/server/bin/psql'`

### <a name="rsanimporter"></a>`rsan::importer`

Class to consume the resources provided by the exporter class.
Expand Down
15 changes: 12 additions & 3 deletions manifests/exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@
# Defaults to the output of a PuppetDB query
# @param [Optional[String]] rsan_host
# The certname of the rsan node
# @param [Optional[String]] pg_user
# The postgres user PE uses
# @param [Optional[String]] pg_group
# The postgres group PE uses the default is pg_user
# @param [Optional[String]] pg_psql_path
# The path to the postgres binary in pe
# @example
# include rsan::exporter
class rsan::exporter (
Array $rsan_importer_ips = rsan::get_rsan_importer_ips(),
Optional[String] $rsan_host = undef,
Optional[String] $pg_user = 'pe-postgres',
Optional[String] $pg_group = $pg_user,
Optional[String] $pg_psql_path = '/opt/puppetlabs/server/bin/psql',
){

########################1. Export Logging Function######################
Expand Down Expand Up @@ -116,9 +125,9 @@
command => $grant_cmd,
db => $db,
port => $pe_postgresql::server::port,
psql_user => $pe_postgresql::server::user,
psql_group => $pe_postgresql::server::group,
psql_path => $pe_postgresql::server::psql_path,
psql_user => $pg_user,
psql_group => $pg_group,
psql_path => $pg_psql_path,
unless => "SELECT grantee, privilege_type FROM information_schema.role_table_grants WHERE privilege_type = 'SELECT' AND grantee = 'rsan'",
require => [
Class['pe_postgresql::server'],
Expand Down

0 comments on commit 050cbc4

Please sign in to comment.