Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #46 (SUP-2384) #47

Merged
merged 3 commits into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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