diff --git a/manifests/collect.pp b/manifests/collect.pp index fa0df3e..1905bc9 100644 --- a/manifests/collect.pp +++ b/manifests/collect.pp @@ -1,4 +1,9 @@ # Create systemd units for repacking a given database type +# @param database_type [String] The database to repack, uses titles from pg_repack.pp +# @param command [String] defined in pg_repack.pp +# @param disable_maintenance [Boolean] to disable maintenance mode (Default: false) +# @param on_cal [String] values can be found in pg_repack.pp +# define pe_databases::collect ( String $database_type = $title, String $command = undef, diff --git a/manifests/init.pp b/manifests/init.pp index d83c332..24af400 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,9 +1,14 @@ -# Tuning, maintenance, and backups for PE PostgreSQL. -# -# @summary Tuning, maintenance, and backups for PE PostgreSQL. - +# @summary Tuning, maintenance for PE PostgreSQL. +# +# @param disable_maintenance [Boolean] true or false (Default: false) +# Disable or enable maintenance mode +# @param manage_postgresql_settings [Boolean] true or false (Default: true) +# Manage PostgreSQL settings +# @param manage_table_settings [Boolean] true or false (Default: false) +# Manage table settings +# @param install_dir [String] Directory to install module into (Default: "/opt/puppetlabs/pe_databases") +# @param scripts_dir [String] Directory to install scripts into (Default: "${install_dir}/scripts") class pe_databases ( - Variant[Boolean,Undef] $manage_database_backups = undef, # Manage the inclusion of the pg_repack class Boolean $manage_database_maintenance = true, # Manage the state of the maintenance tasks, i.e. systemd services and timers diff --git a/manifests/pg_repack.pp b/manifests/pg_repack.pp index c19aaa5..9d46360 100644 --- a/manifests/pg_repack.pp +++ b/manifests/pg_repack.pp @@ -1,7 +1,11 @@ # Maintenance pg_repack # -# @summary Maintenance pg_repack - +# @summary +# Provides systemd timers to pg_repack tables in the pe-puppetdb database +# +# @param disable_maintenance [Boolean] true or false (Default: false) +# Disable or enable maintenance mode +# @param jobs [Integer] How many jobs to run in parallel class pe_databases::pg_repack ( Boolean $disable_maintenance = false, Integer $jobs = $facts['processors']['count'] / 4 diff --git a/manifests/postgresql_settings.pp b/manifests/postgresql_settings.pp index a9f9332..b3adc3e 100644 --- a/manifests/postgresql_settings.pp +++ b/manifests/postgresql_settings.pp @@ -1,7 +1,13 @@ # Tune PostgreSQL # -# @summary Tune PostgreSQL - +# @summary +# Tune PostgreSQL settings +# +# @param maintenance_work_mem [String] Increase to improve speed of speed of vacuuming and reindexing (Example "1GB") +# @param work_mem [String] Allows PostgreSQL to do larger in-memory sorts (Default: "4MB") +# @param autovacumn_work_mem [String] Similar to but for maintenance_work_mem autovacuum processes only (Example "256MB") +# @param autovacuum_max_workers [Integer] Maximum number of autovacuum processes to run concurrently (Default: 3) +# class pe_databases::postgresql_settings ( # lint:ignore:140chars Float[0,1] $autovacuum_vacuum_scale_factor = 0.08, diff --git a/manifests/postgresql_settings/table_settings.pp b/manifests/postgresql_settings/table_settings.pp index d016d60..6b05d6a 100644 --- a/manifests/postgresql_settings/table_settings.pp +++ b/manifests/postgresql_settings/table_settings.pp @@ -1,7 +1,8 @@ # Tune PostgreSQL table settings # -# @summary Tune PostgreSQL table settings - +# @summary +# Tune PostgreSQL table settings +# class pe_databases::postgresql_settings::table_settings ( # lint:ignore:140chars Boolean $manage_reports_autovacuum_cost_delay = lookup('pe_databases::postgresql_settings::manage_reports_autovacuum_cost_delay', {'default_value' => true}), diff --git a/manifests/set_puppetdb_table_autovacuum_cost_delay_zero.pp b/manifests/set_puppetdb_table_autovacuum_cost_delay_zero.pp index b4c755e..ed2fdfb 100644 --- a/manifests/set_puppetdb_table_autovacuum_cost_delay_zero.pp +++ b/manifests/set_puppetdb_table_autovacuum_cost_delay_zero.pp @@ -1,7 +1,10 @@ # Defined type for PostgreSQL autovacuum_cost_delay # -# @summary Defined type for PostgreSQL autovacuum_cost_delay - +# @summary +# Defined type for PostgreSQL autovacuum_cost_delay +# +# @param table_name [String] +# Name of the table define pe_databases::set_puppetdb_table_autovacuum_cost_delay_zero ( String $table_name = $title, ) { diff --git a/manifests/set_table_attribute.pp b/manifests/set_table_attribute.pp index a392999..bdd4018 100644 --- a/manifests/set_table_attribute.pp +++ b/manifests/set_table_attribute.pp @@ -1,7 +1,17 @@ # Defined type for PostgreSQL table attributes # -# @summary Defined type for PostgreSQL table attributes - +# @summary +# Defined type for PostgreSQL table attributes +# +# @param db [String] +# Name of the database, this is pe-puppetdb for the uses of this module. +# @param table_name [String] +# Name of the table in the database. +# @param table_attribute [String] +# Set to the table attribute value. +# @param table_attribute_value [String] +# Value of setting for the table set in table_settings.pp +# define pe_databases::set_table_attribute ( String $db, String $table_name, diff --git a/spec/classes/pg_repack_spec.rb b/spec/classes/pg_repack_spec.rb index e5454f9..c37aba1 100644 --- a/spec/classes/pg_repack_spec.rb +++ b/spec/classes/pg_repack_spec.rb @@ -5,7 +5,6 @@ context "on #{os}" do let(:pre_condition) do "class { 'pe_databases': - manage_database_backups => false, manage_postgresql_settings => false, manage_table_settings => false, }"