Showing with 67 additions and 58 deletions.
  1. +0 −2 .puppet-lint.rc
  2. +7 −0 .rubocop.yml
  3. +0 −5 .sync.yml
  4. +8 −7 .travis.yml
  5. +5 −0 CHANGELOG.md
  6. +4 −4 Gemfile
  7. +2 −2 Rakefile
  8. +4 −4 manifests/init.pp
  9. +16 −12 manifests/maintenance/pg_repack.pp
  10. +11 −11 manifests/maintenance/vacuum_full.pp
  11. +3 −6 manifests/postgresql_settings/table_settings.pp
  12. +4 −4 metadata.json
  13. +1 −1 spec/default_facts.yml
  14. +2 −0 spec/spec_helper.rb
2 changes: 0 additions & 2 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
--relative
--no-2sp_soft_tabs-check
--no-arrow_alignment-check
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/**/*
Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand Down Expand Up @@ -88,6 +89,12 @@ Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
GetText/DecorateFunctionMessage:
Enabled: false
GetText/DecorateStringFormattingUsingInterpolation:
Enabled: false
GetText/DecorateStringFormattingUsingPercent:
Enabled: false
Layout/EndOfLine:
Enabled: false
Layout/IndentHeredoc:
Expand Down
5 changes: 0 additions & 5 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ spec/default_facts.yml:
processors:
"count": 8

Rakefile:
extra_disabled_lint_checks:
- '2sp_soft_tabs'
- 'arrow_alignment'

.travis.yml:
includes:
- env: PUPPET_GEM_VERSION="= 4.6.1" CHECK=parallel_spec
Expand Down
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
---
os: linux
dist: xenial
language: ruby
cache: bundler
before_install:
- bundle -v
- rm -f Gemfile.lock
- gem update --system $RUBYGEMS_VERSION
- "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
- "# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used"
- "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set"
- '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION'
- gem --version
- bundle -v
script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.5.3
- 2.5.7
stages:
- static
- spec
- acceptance
-
if: tag =~ ^v\d
name: deploy
matrix:
jobs:
fast_finish: true
include:
-
Expand All @@ -32,14 +36,11 @@ matrix:
stage: spec
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
rvm: 2.5.7
stage: spec
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
-
env: PUPPET_GEM_VERSION="= 4.6.1" CHECK=parallel_spec
rvm: 2.1.9
branches:
only:
- master
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Minor Release 1.0.1

- Correct lint issues found on the Forge
- Update to PDK 1.17.0

## Major Release 1.0.0

- Move from the npwalker namespace to the puppetlabs namespace.
Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ group :development do
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
Expand Down Expand Up @@ -39,8 +41,6 @@ def changelog_future_release
end

PuppetLint.configuration.send('disable_relative')
PuppetLint.configuration.send('disable_2sp_soft_tabs')
PuppetLint.configuration.send('disable_arrow_alignment')

if Bundler.rubygems.find_name('github_changelog_generator').any?
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
Expand Down
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
if $manage_postgresql_settings and (versioncmp('2018.1.0', $facts['pe_server_version']) > 0) {
include pe_databases::postgresql_settings
class { 'pe_databases::postgresql_settings::table_settings' :
manage_reports_autovacuum_cost_delay => $pe_databases::postgresql_settings::manage_reports_autovacuum_cost_delay,
factsets_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::factsets_autovacuum_vacuum_scale_factor,
reports_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::reports_autovacuum_vacuum_scale_factor,
require => Class['pe_databases::postgresql_settings'],
manage_reports_autovacuum_cost_delay => $pe_databases::postgresql_settings::manage_reports_autovacuum_cost_delay,
factsets_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::factsets_autovacuum_vacuum_scale_factor,
reports_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::reports_autovacuum_vacuum_scale_factor,
require => Class['pe_databases::postgresql_settings'],
}
} elsif $manage_table_settings {
# This is to provide for situations, like PE XL,
Expand Down
28 changes: 16 additions & 12 deletions manifests/maintenance/pg_repack.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,25 @@

# PE 2019.1 starting shipping versioned pe-postgres packages where all paths are versioned.
# So, prior to 2019.1 use a non-versioned path, and after use a versioned path.

# TODO: Use $pe_databases::psql_version after identifying why it is cast to ${psql_version}00000 in spec tests.
$postgresql_version = $facts['pe_postgresql_info']['installed_server_version']
$repack_executable = versioncmp('2019.1.0', $facts['pe_server_version']) ? {
1 => '/opt/puppetlabs/server/apps/postgresql/bin/pg_repack',
default => "/opt/puppetlabs/server/apps/postgresql/${$postgresql_version}/bin/pg_repack" }
1 => '/opt/puppetlabs/server/apps/postgresql/bin/pg_repack',
default => "/opt/puppetlabs/server/apps/postgresql/${postgresql_version}/bin/pg_repack"
}

$repack = "su - pe-postgres -s /bin/bash -c \"${repack_executable} -d pe-puppetdb"
$repack_jobs = "--jobs ${jobs}"

$facts_tables = '-t factsets -t fact_paths"'
$catalogs_tables = '-t catalogs -t catalog_resources -t edges -t certnames"'
$other_tables = '-t producers -t resource_params -t resource_params_cache"'

$reports_tables = versioncmp('2019.1.0', $facts['pe_server_version']) ? {
1 => '-t reports"',
default => '-t reports -t resource_events"' }
1 => '-t reports"',
default => '-t reports -t resource_events"'
}

$logging = "> ${logging_directory}/output.log 2>&1"

Cron {
Expand All @@ -40,16 +44,16 @@

cron { 'pg_repack facts tables' :
weekday => [2,6],
hour => 4,
minute => 30,
command => "${repack} ${repack_jobs} ${facts_tables} ${logging}",
hour => 4,
minute => 30,
command => "${repack} ${repack_jobs} ${facts_tables} ${logging}",
}

cron { 'pg_repack catalogs tables' :
weekday => [0,4],
hour => 4,
minute => 30,
command => "${repack} ${repack_jobs} ${catalogs_tables} ${logging}",
weekday => [0,4],
hour => 4,
minute => 30,
command => "${repack} ${repack_jobs} ${catalogs_tables} ${logging}",
}

cron { 'pg_repack other tables' :
Expand Down
22 changes: 11 additions & 11 deletions manifests/maintenance/vacuum_full.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@
}

Cron {
ensure => $ensure_cron,
user => 'root',
require => File[$logging_directory, $script_directory],
ensure => $ensure_cron,
user => 'root',
require => File[$logging_directory, $script_directory],
}

cron { 'VACUUM FULL facts tables' :
weekday => [2,6],
hour => 4,
minute => 30,
command => "${vacuum_script_path} facts",
weekday => [2,6],
hour => 4,
minute => 30,
command => "${vacuum_script_path} facts",
}

cron { 'VACUUM FULL catalogs tables' :
weekday => [0,4],
hour => 4,
minute => 30,
command => "${vacuum_script_path} catalogs",
weekday => [0,4],
hour => 4,
minute => 30,
command => "${vacuum_script_path} catalogs",
}

cron { 'VACUUM FULL other tables' :
Expand Down
9 changes: 3 additions & 6 deletions manifests/postgresql_settings/table_settings.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

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}),
Optional[Float[0,1]] $factsets_autovacuum_vacuum_scale_factor = lookup('pe_databases::postgresql_settings::factsets_autovacuum_vacuum_scale_factor',
{'default_value' => 0.80}),
Optional[Float[0,1]] $reports_autovacuum_vacuum_scale_factor = lookup('pe_databases::postgresql_settings::reports_autovacuum_vacuum_scale_factor',
{'default_value' => 0.01}),
Boolean $manage_reports_autovacuum_cost_delay = lookup('pe_databases::postgresql_settings::manage_reports_autovacuum_cost_delay', {'default_value' => true}),
Optional[Float[0,1]] $factsets_autovacuum_vacuum_scale_factor = lookup('pe_databases::postgresql_settings::factsets_autovacuum_vacuum_scale_factor', {'default_value' => 0.80}),
Optional[Float[0,1]] $reports_autovacuum_vacuum_scale_factor = lookup('pe_databases::postgresql_settings::reports_autovacuum_vacuum_scale_factor', {'default_value' => 0.01}),
Optional[Float[0,1]] $catalogs_autovacuum_vacuum_scale_factor = 0.75,
Optional[Float[0,1]] $certnames_autovacuum_vacuum_scale_factor = 0.75,
# lint:endignore
Expand Down
8 changes: 4 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-pe_databases",
"version": "1.0.0",
"version": "1.0.1",
"author": "puppetlabs",
"summary": "A Puppet Module for Backing Up / Maintaining / Tuning Your Puppet Enterprise Databases",
"license": "Apache-2.0",
Expand Down Expand Up @@ -77,7 +77,7 @@
"version_requirement": ">= 5.5.0"
}
],
"pdk-version": "1.14.0.pre (heads/master-0-g9158517)",
"template-url": "https://github.com/puppetlabs/pdk-templates#add_circleci_and_azure_pipelines_support",
"template-ref": "remotes/origin/add_circleci_and_azure_pipelines_support-0-gdc89556"
"pdk-version": "1.17.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#master",
"template-ref": "tags/1.17.0-0-gd3a4319"
}
2 changes: 1 addition & 1 deletion spec/default_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Facts specified here will override the values provided by rspec-puppet-facts.
---
ipaddress: "172.16.254.254"
ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA"
pe_server_version: 2018.1.0
Expand All @@ -14,4 +15,3 @@ processors:
count: 8
pe_postgresql_info:
installed_server_version: 9.6

2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.configure do |c|
c.mock_with :rspec
end
Expand Down