Skip to content

Commit

Permalink
Formatting and Refactoring Changes to Vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronoftheages committed Jan 30, 2024
1 parent af7068b commit 69e6d4e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions manifests/pg_repack.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@
# @param activity_tables [Array] Array of 'activity' tables to repack
# @param disable_maintenance [Boolean] true or false (Default: false)
# Disable or enable maintenance mode
# @param repack_log_level [Enum] Desired output level of logs
# @param enable_echo [Boolean] true or false (Default: true)
# Enabling echo output in logs
# @param jobs [Integer] How many jobs to run in parallel
# @param facts_tables_repack_timer [String] The Systemd timer for the pg_repack job affecting the 'facts' tables
# @param catalogs_tables_repack_timer [String]The Systemd timer for the pg_repack job affecting the 'catalog' tables
# @param other_tables_repack_timer [String] The Systemd timer for the pg_repack job affecting the 'other' tables
# @param activity_tables_repack_timer [String] The Systemd timer for the pg_repack job affecting the 'activity' tables
# @param reports_tables_repack_timer [String] Deprecated Parameter will be removed in future releases
# @param resource_events_tables_repack_timer [String] Deprecated Parameter will be removed in future releases
# @param repack_run_level
# @param enable_echo
class pe_databases::pg_repack (
# Provided by module data
Array $fact_tables,
Array $catalog_tables,
Array $other_tables,
Array $activity_tables,
Boolean $disable_maintenance = false,
Enum['INFO','NOTICE','WARNING', 'ERROR', 'LOG', 'FATAL','PANIC','DEBUG'] $repack_run_level='DEBUG',
Enum['INFO','NOTICE','WARNING','ERROR','LOG','FATAL','PANIC','DEBUG'] $repack_log_level='DEBUG',
Boolean $enable_echo = true,
Integer $jobs = $facts['processors']['count'] / 4,
String[1] $facts_tables_repack_timer = $pe_databases::facts_tables_repack_timer,
Expand All @@ -40,14 +41,11 @@
$postgresql_version = $facts['pe_postgresql_info']['installed_server_version']
$repack_executable = "/opt/puppetlabs/server/apps/postgresql/${postgresql_version}/bin/pg_repack"

#Add conditionals,
#If echo enabled = true run WITH
if $enable_echo {
$repack_cmd = "${repack_executable} --jobs ${jobs} --elevel ${repack_run_level} --echo"

Check warning on line 45 in manifests/pg_repack.pp

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

top-scope variable being used without an explicit namespace (check: variable_scope)

Check warning on line 45 in manifests/pg_repack.pp

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

top-scope variable being used without an explicit namespace (check: variable_scope)
} else {
$repack_cmd = "${repack_executable} --jobs ${jobs} --elevel ${repack_run_level}"

Check warning on line 47 in manifests/pg_repack.pp

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

top-scope variable being used without an explicit namespace (check: variable_scope)

Check warning on line 47 in manifests/pg_repack.pp

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

top-scope variable being used without an explicit namespace (check: variable_scope)
}
#else echo ommited - run without echo

pe_databases::collect { 'facts':
disable_maintenance => $disable_maintenance,
Expand Down

0 comments on commit 69e6d4e

Please sign in to comment.