Skip to content

(SUP-3409) Update puppet strings comments #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions manifests/collect.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
15 changes: 10 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions manifests/pg_repack.pp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 8 additions & 2 deletions manifests/postgresql_settings.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
5 changes: 3 additions & 2 deletions manifests/postgresql_settings/table_settings.pp
Original file line number Diff line number Diff line change
@@ -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}),
Expand Down
7 changes: 5 additions & 2 deletions manifests/set_puppetdb_table_autovacuum_cost_delay_zero.pp
Original file line number Diff line number Diff line change
@@ -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,
) {
Expand Down
14 changes: 12 additions & 2 deletions manifests/set_table_attribute.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 0 additions & 1 deletion spec/classes/pg_repack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}"
Expand Down