Merge pull request #35 from nicklewis/add-ttl-settings
Add params and ini_settings for node/report/purge ttls
This commit is contained in:
commit
04d5bf1b56
5 changed files with 64 additions and 2 deletions
14
README.md
14
README.md
|
@ -193,7 +193,19 @@ The password for the database user (defaults to `puppetdb`; ignored for `embedde
|
|||
|
||||
The name of the database instance to connect to (defaults to `puppetdb`; ignored for `embedded` db).
|
||||
|
||||
####`database_package`
|
||||
####`node_ttl`
|
||||
|
||||
The length of time a node can go without receiving any new data before it's automatically deactivated. (defaults to '0', which disables auto-deactivation). This option is supported in PuppetDB >= 1.1.0.
|
||||
|
||||
####`node_purge_ttl`
|
||||
|
||||
The length of time a node can be deactivated before it's deleted from the database. (defaults to '0', which disables purging). This option is supported in PuppetDB >= 1.2.0.
|
||||
|
||||
####`report_ttl`
|
||||
|
||||
The length of time reports should be stored before being deleted. (defaults to '7d', which is a 7-day period). This option is supported in PuppetDB >= 1.1.0.
|
||||
|
||||
####`puppetdb_package`
|
||||
|
||||
The puppetdb package name in the package manager.
|
||||
|
||||
|
|
|
@ -42,6 +42,18 @@
|
|||
# (defaults to `puppetdb`; ignored for `embedded` db)
|
||||
# ['database_name'] - The name of the database instance to connect to.
|
||||
# (defaults to `puppetdb`; ignored for `embedded` db)
|
||||
# ['node_ttl'] - The length of time a node can go without receiving
|
||||
# any new data before it's automatically deactivated.
|
||||
# (defaults to '0', which disables auto-deactivation)
|
||||
# This option is supported in PuppetDB >= 1.1.0.
|
||||
# ['node_purge_ttl'] - The length of time a node can be deactivated before
|
||||
# it's deleted from the database.
|
||||
# (defaults to '0', which disables purging)
|
||||
# This option is supported in PuppetDB >= 1.2.0.
|
||||
# ['report_ttl'] - The length of time reports should be stored before
|
||||
# being deleted.
|
||||
# (defaults to '7d', which is a 7-day period)
|
||||
# This option is supported in PuppetDB >= 1.1.0.
|
||||
# ['open_postgres_port'] - If true, open the postgres port on the firewall.
|
||||
# (defaults to true).
|
||||
# ['puppetdb_package'] - The puppetdb package name in the package manager
|
||||
|
@ -83,6 +95,9 @@ class puppetdb(
|
|||
$database_username = $puppetdb::params::database_username,
|
||||
$database_password = $puppetdb::params::database_password,
|
||||
$database_name = $puppetdb::params::database_name,
|
||||
$node_ttl = $puppetdb::params::node_ttl,
|
||||
$node_purge_ttl = $puppetdb::params::node_purge_ttl,
|
||||
$report_ttl = $puppetdb::params::report_ttl,
|
||||
$puppetdb_package = $puppetdb::params::puppetdb_package,
|
||||
$puppetdb_version = $puppetdb::params::puppetdb_version,
|
||||
$puppetdb_service = $puppetdb::params::puppetdb_service,
|
||||
|
|
|
@ -41,6 +41,11 @@ class puppetdb::params {
|
|||
$database_username = 'puppetdb'
|
||||
$database_password = 'puppetdb'
|
||||
|
||||
# These settings manage the various auto-deactivation and auto-purge settings
|
||||
$node_ttl = '0'
|
||||
$node_purge_ttl = '0'
|
||||
$report_ttl = '7d'
|
||||
|
||||
$puppetdb_version = 'present'
|
||||
|
||||
# TODO: figure out a way to make this not platform-specific
|
||||
|
|
|
@ -51,7 +51,19 @@
|
|||
# (defaults to `puppetdb`; ignored for `embedded` db)
|
||||
# ['database_name'] - The name of the database instance to connect to.
|
||||
# (defaults to `puppetdb`; ignored for `embedded` db)
|
||||
# ['database_package'] - The puppetdb package name in the package manager
|
||||
# ['node_ttl'] - The length of time a node can go without receiving
|
||||
# any new data before it's automatically deactivated.
|
||||
# (defaults to '0', which disables auto-deactivation)
|
||||
# This option is supported in PuppetDB >= 1.1.0.
|
||||
# ['node_purge_ttl'] - The length of time a node can be deactivated before
|
||||
# it's deleted from the database.
|
||||
# (defaults to '0', which disables purging)
|
||||
# This option is supported in PuppetDB >= 1.2.0.
|
||||
# ['report_ttl'] - The length of time reports should be stored before
|
||||
# being deleted.
|
||||
# (defaults to '7d', which is a 7-day period)
|
||||
# This option is supported in PuppetDB >= 1.1.0.
|
||||
# ['puppetdb_package'] - The puppetdb package name in the package manager
|
||||
# ['puppetdb_version'] - The version of the `puppetdb` package that should
|
||||
# be installed. You may specify an explicit version
|
||||
# number, 'present', or 'latest'. Defaults to
|
||||
|
@ -93,6 +105,9 @@ class puppetdb::server(
|
|||
$database_username = $puppetdb::params::database_username,
|
||||
$database_password = $puppetdb::params::database_password,
|
||||
$database_name = $puppetdb::params::database_name,
|
||||
$node_ttl = $puppetdb::params::node_ttl,
|
||||
$node_purge_ttl = $puppetdb::params::node_purge_ttl,
|
||||
$report_ttl = $puppetdb::params::report_ttl,
|
||||
$puppetdb_package = $puppetdb::params::puppetdb_package,
|
||||
$puppetdb_version = $puppetdb::params::puppetdb_version,
|
||||
$puppetdb_service = $puppetdb::params::puppetdb_service,
|
||||
|
|
|
@ -113,4 +113,19 @@ class puppetdb::server::database_ini(
|
|||
setting => 'gc-interval',
|
||||
value => $puppetdb::params::gc_interval,
|
||||
}
|
||||
|
||||
ini_setting {'puppetdb_node_ttl':
|
||||
setting => 'node-ttl',
|
||||
value => $puppetdb::params::node_ttl,
|
||||
}
|
||||
|
||||
ini_setting {'puppetdb_node_purge_ttl':
|
||||
setting => 'node-purge-ttl',
|
||||
value => $puppetdb::params::node_purge_ttl,
|
||||
}
|
||||
|
||||
ini_setting {'puppetdb_report_ttl':
|
||||
setting => 'report-ttl',
|
||||
value => $puppetdb::params::report_ttl,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue