diff --git a/README.md b/README.md index a604ea2b..521b2f0d 100644 --- a/README.md +++ b/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. diff --git a/manifests/init.pp b/manifests/init.pp index 3ab12074..9c9acfaf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 @@ $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, diff --git a/manifests/params.pp b/manifests/params.pp index eb7b241a..fb999226 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -41,6 +41,11 @@ $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 diff --git a/manifests/server.pp b/manifests/server.pp index 30e650d3..cd4c2519 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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 @@ $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, diff --git a/manifests/server/database_ini.pp b/manifests/server/database_ini.pp index 21910a5e..f32ca222 100644 --- a/manifests/server/database_ini.pp +++ b/manifests/server/database_ini.pp @@ -113,4 +113,19 @@ 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, + } }