Overview

This resource allows you to set the defaults for all other pg types.

Here is an example on how to create the default settings:

pg_setting { '<SID>':
  default        => true|false,
  user           => '<username>',
  password       => '<password>',
  connect_string => "[//]host[:port][/service_name][:server][/instance]",
}

If you want to manage a remote database, like for instance DB1. You will have to specify a local pgcle_home from where sqlplus can be started. You use pg_setting like this:

pg_setting { 'DB1':
  default        => true,
  user           => 'postgres',
  password       => 'password',
  connect_string => '//host1:1522/DB1',
  pluggable      => false,

Attributes

Attribute Name Short Description
connect_string The connect string to use for the database.
daemonized Use daemonized sqlplus process for processing.
default Oracle types.
disable_corrective_change Disable the modification of a resource when Puppet decides it is a corrective change.
disable_corrective_ensure Disable the creation or removal of a resource when Puppet decides is a corrective change.
name The name of the setting.
os_user The os_user that is used for the connect.
password The password to use for database sys operations.
provider resource.
user The database username to use for database sysdba operations.

connect_string

The connect string to use for the database.

Here is an example:

pg_setting { 'DB1':
  ...
  connect_string     => "//host1:1522/DB1",
  ...
}

Not yet supported.

Back to overview of pg_setting

daemonized

Use daemonized sqlplus process for processing.

By default Puppet will create a new sqlplus session for every set of information it needs to retrieve. This can put some strain on the Oracle database. When you want to decrease this, you can set the daemonized setting to true. This wil create a single daemon process for every database it needs to connect to and share this process for all sql processing.

This is however more prone to instability. So use with care.

The default value is true e.g. run sqlplus as a daemon.

pg_setting {'mydb'
  ...
  daemonized => true,
  ...
}

Not yet supported

Back to overview of pg_setting

default

When you set this value to true, this database will be used when no explcit sid is specified on the Oracle types.

Many of the of the postgres types, allow you to NOT specfify the db and use a default db. This makes puppet manifests easier readable and less verbose when creating a manifest for a single database.

The databasse for which you set the property default to true, is the database that will be used for those operations.

Valid values are true, false.

Back to overview of pg_setting

disable_corrective_change

Disable the modification of a resource when Puppet decides it is a corrective change.

(requires easy_type V2.11.0 or higher)

When using a Puppet Server, Puppet knows about adaptive and corrective changes. A corrective change is when Puppet notices that the resource has changed, but the catalog has not changed. This can occur for example, when a user, by accident or willingly, changed something on the system that Puppet is managing. The normal Puppet process then repairs this and puts the resource back in the state as defined in the catalog. This process is precisely what you want most of the time, but not always. This can sometimes also occur when a hardware or network error occurs. Then Puppet cannot correctly determine the current state of the system and thinks the resource is changed, while in fact, it is not. Letting Puppet recreate remove or change the resource in these cases, is NOT wat you want.

Using the disable_corrective_change parameter, you can disable corrective changes on the current resource.

Here is an example of this:

crucial_resource {'be_carefull':
  ...
  disable_corrective_change => true,
  ...
}

When a corrective ensure does happen on the resource Puppet will not modify the resource and signal an error:

    Error: Corrective change present requested by catalog, but disabled by parameter disable_corrective_change
    Error: /Stage[main]/Main/Crucial_resource[be_carefull]/parameter: change from '10' to '20' failed: Corrective change present requested by catalog, but disabled by parameter disable_corrective_change. (corrective)

Back to overview of pg_setting

disable_corrective_ensure

Disable the creation or removal of a resource when Puppet decides is a corrective change.

(requires easy_type V2.11.0 or higher)

When using a Puppet Server, Puppet knows about adaptive and corrective changes. A corrective change is when Puppet notices that the resource has changed, but the catalog has not changed. This can occur for example, when a user, by accident or willingly, changed something on the system that Puppet is managing. The normal Puppet process then repairs this and puts the resource back in the state as defined in the catalog. This process is precisely what you want most of the time, but not always. This can sometimes also occur when a hardware or network error occurs. Then Puppet cannot correctly determine the current state of the system and thinks the resource is changed, while in fact, it is not. Letting Puppet recreate remove or change the resource in these cases, is NOT wat you want.

Using the disable_corrective_ensure parameter, you can disable corrective ensure present or ensure absent actions on the current resource.

Here is an example of this:

crucial_resource {'be_carefull':
  ensure                    => 'present',
  ...
  disable_corrective_ensure => true,
  ...
}

When a corrective ensure does happen on the resource Puppet will not create or remove the resource and signal an error:

    Error: Corrective ensure present requested by catalog, but disabled by parameter disable_corrective_ensure.
    Error: /Stage[main]/Main/Crucial_resource[be_carefull]/ensure: change from 'absent' to 'present' failed: Corrective ensure present requested by catalog, but disabled by parameter disable_corrective_ensure. (corrective)

Back to overview of pg_setting

name

The name of the setting. This must be equal to the name of the database.

Back to overview of pg_setting

os_user

The os_user that is used for the connect. By default this is postgres.

Back to overview of pg_setting

password

The password to use for database sys operations. This value is required when the database is not local. E.g the database is running on a remote server and is connected to through a remote connection string.

Here is an example on how to use this:

pg_setting { ‘db1’: … user => ‘postgres’, password => ‘password’, … }

Back to overview of pg_setting

provider

The specific backend to use for this pg_setting resource. You will seldom need to specify this — Puppet will usually discover the appropriate provider for your platform.Available providers are:

simple
Manage postgres settings through yaml file

Back to overview of pg_setting

user

The database username to use for database sysdba operations. This value is required when the database is not local. E.g the database is running on a remote server and is connected to through a remote connection string.

Here is an example on how to use this:

pg_setting { 'DB1':
  ...
  user               => 'postgres',
  password           => 'password',
  ...
}

Back to overview of pg_setting