Defined Type: postgresql::server::pg_ident_rule

Defined in:
manifests/server/pg_ident_rule.pp

Summary

This resource manages an individual rule that applies to the file defined in target.

Overview

Parameters:

  • map_name (Any)

    Sets the name of the user map that is used to refer to this mapping in pg_hba.conf.

  • system_username (Any)

    Specifies the operating system user name (the user name used to connect to the database).

  • database_username (Any)

    Specifies the user name of the database user. The system_username is mapped to this user name.

  • description (Any) (defaults to: 'none')

    Sets a longer description for this rule if required. This description is placed in the comments above the rule in pg_ident.conf. Default value: ‘none’.

  • order (Any) (defaults to: '150')

    Defines an order for placing the mapping in pg_ident.conf. Default value: 150.

  • target (Any) (defaults to: $postgresql::server::pg_ident_conf_path)

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



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'manifests/server/pg_ident_rule.pp', line 9

define postgresql::server::pg_ident_rule (
  $map_name,
  $system_username,
  $database_username,
  $description = 'none',
  $order       = '150',

  # Needed for testing primarily, support for multiple files is not really
  # working.
  $target      = $postgresql::server::pg_ident_conf_path
) {
  if $postgresql::server::manage_pg_ident_conf == false {
    fail('postgresql::server::manage_pg_ident_conf has been disabled, so this resource is now unused and redundant, either enable that option or remove this resource from your manifests')
  } else {
    # Create a rule fragment
    $fragname = "pg_ident_rule_${name}"
    concat::fragment { $fragname:
      target  => $target,
      content => template('postgresql/pg_ident_rule.conf'),
      order   => $order,
    }
  }
}