Skip to content
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
8 changes: 6 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
require: rubocop-rspec
require:
- rubocop-rspec
- rubocop-i18n
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
Expand All @@ -19,10 +21,12 @@ AllCops:
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/*
- spec/**/*
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
dist: trusty
dist: xenial
language: ruby
cache: bundler
before_install:
Expand Down
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"jpogran.puppet-vscode",
"rebornix.Ruby"
]
}
21 changes: 11 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
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 "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
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]
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
returnVal = nil || JSON.load(File.read('metadata.json'))['source'].match(%r{.*/([^/]*)})[1]
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator project:#{returnVal}"
returnVal
Expand Down
7 changes: 4 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"version_requirement": ">= 5.3.2 < 7.0.0"
}
],
"pdk-version": "1.11.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#1.10.0",
"template-ref": "1.10.0-0-gbba9ac3"
"pdk-version": "1.12.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#1.12.0",
"template-ref": "1.12.0-0-g55d9ae2"
}

7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
end
end

# read default_facts and merge them over what is provided by facterdb
default_facts.each do |fact, value|
add_custom_fact fact, value
end

RSpec.configure do |c|
c.default_facts = default_facts
c.before :each do
Expand All @@ -37,6 +42,8 @@
end
end

# Ensures that a module is defined
# @param module_name Name of the module
def ensure_module_defined(module_name)
module_name.split('::').reduce(Object) do |last_module, next_module|
last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false)
Expand Down
14 changes: 7 additions & 7 deletions tasks/kb0263_rename_pe_master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stopsvc() {
if ! $PUPPETCMD resource service "$service" ensure=stopped
then
echo "Unable to stop '${service}'. Exiting"
exit -1
exit 255
fi
}

Expand All @@ -31,31 +31,31 @@ tar -cvf "/etc/puppetlabs/puppet/ssl_$(date +%Y-%m-%d-%M-%S).tar.gz" /etc/puppet
grep reverse-proxy-ca-service /etc/puppetlabs/puppetserver/bootstrap.cfg 2>&1 /dev/null
if [ $? -eq 0 ]; then
echo "Target server appears to be a PE compile master. This script is intended to be targeted only at a PE Master of Masters. Exiting."
exit -1
exit 255
elif [ $? -eq 2 ]; then
echo "Target server does not appear to be a PE master. This script is intended to be targeted only at a PE Master of Masters. Exiting."
exit -1
exit 255
fi

if [ ! -x $PUPPETCMD ]; then
echo "Unable to locate executable Puppet command at ${PUPPETCMD}"
exit -1
exit 255
fi

if [ -z "$HOSTNAME" ]; then
echo "'hostname -f' is returning an empty string. Perhaps name resolution is not configured?"
exit -1
exit 255
fi

if [ "$HOSTNAME" = "$(puppet config print certname)" ]; then
echo "This script assumes the hostname has already been changed. The hostname currently matches the certname in puppet.conf. Exiting."
exit -1
exit 255
fi

if ! ping -qc 1 "$HOSTNAME" > /dev/null
then
echo "The new hostname $HOSTNAME is not pingable. Make sure name resolution is configured"
exit -2
exit 255
fi

for svc in puppet pe-puppetserver pe-activemq mcollective pe-puppetdb pe-postgresql pe-console-services pe-nginx pe-orchestration-services pxp-agent; do
Expand Down
8 changes: 4 additions & 4 deletions tasks/kb0299_regen_master_cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ exit_if_compile_master() {
grep reverse-proxy-ca-service /etc/puppetlabs/puppetserver/bootstrap.cfg 2>&1 /dev/null
if [ $? -eq 0 ]; then
echo "Target server appears to be a PE compile master. This script is intended to be targeted only at a PE Master of Masters. Exiting."
exit -1
exit 255
elif [ $? -eq 2 ]; then
echo "Target server does not appear to be a PE master. This script is intended to be targeted only at a PE Master of Masters. Exiting."
exit -1
exit 255
fi
}

Expand All @@ -39,7 +39,7 @@ check_dns_alt_names() {
if ! grep "pe_install::puppet_master_dnsaltname.*${tmphost}" /etc/puppetlabs/enterprise/conf.d/pe.conf > /dev/null 2>&1
then
echo "'${tmphost}' is set up as a DNS alt name in the existing certificate, but is not present in the 'pe_install::puppet_master_dnsaltnames' setting of '/etc/puppetlabs/enterprise/conf.d/pe.conf'. Please add it to continue, or use the 'dnsaltname_override' task parameter to skip this check."
exit -1
exit 255
fi
done
}
Expand All @@ -62,7 +62,7 @@ fi

if [ ! -x $PUPPETCMD ]; then
echo "Unable to locate executable Puppet command at ${PUPPETCMD}"
exit -1
exit 255
fi

# Back up the SSL directories
Expand Down