Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
+Metrics/BlockNesting:
+ Enabled: false
RSpec/DescribeClass:
Enabled: false
RSpec/ExampleLength:
---
-dist: xenial
language: ruby
cache: bundler
before_install:
fast_finish: true
include:
-
- bundler_args:
+ bundler_args:
dist: trusty
- env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
+ env: PLATFORMS=deb_puppet5
rvm: 2.5.3
- script: bundle exec rake beaker
+ before_script:
+ - bundle exec rake 'litmus:provision_list[travis_deb]'
+ - bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
+ - bundle exec rake 'litmus:install_agent[puppet5]'
+ - bundle exec rake litmus:install_module
+ script:
+ - bundle exec rake litmus:acceptance:parallel
services: docker
stage: acceptance
sudo: required
-
- bundler_args:
+ bundler_args:
dist: trusty
- env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply
+ env: PLATFORM=deb_puppet6
rvm: 2.5.3
- script: bundle exec rake beaker
+ before_script:
+ - bundle exec rake 'litmus:provision_list[travis_deb]'
+ - bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
+ - bundle exec rake 'litmus:install_agent[puppet6]'
+ - bundle exec rake litmus:install_module
+ script:
+ - bundle exec rake litmus:acceptance:parallel
services: docker
- stage: acceptance
sudo: required
-
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
end
-group :system_tests do
- gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
- gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
-end
puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"
- 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?
+
+ returnVal = nil
+ returnVal ||= begin
+ metadata_source = JSON.load(File.read('metadata.json'))['source']
+ metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
+
+ metadata_source_match && metadata_source_match[1]
+ end
+
+ raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
+
puts "GitHubChangelogGenerator project:#{returnVal}"
returnVal
end
end
if should_negate
resource_value, wrong_values = resource_value.map { |value|
- # rubocop:disable Metrics/BlockNesting
if value.is_a?(String)
wrong = value unless value =~ %r{^!\s+}
[value.sub(%r{^!\s*}, ''), wrong]
}
],
"template-url": "https://github.com/puppetlabs/pdk-templates#master",
- "template-ref": "1.12.0-0-g55d9ae2",
- "pdk-version": "1.12.0"
+ "template-ref": "tags/1.13.0-0-g66e1443",
+ "pdk-version": "1.13.0"
}
end
end
-
- describe 'nflog', unless: get_iptables_version < '1.3.7' do
+ describe 'nflog', unless: iptables_version < '1.3.7' do
describe 'nflog_group' do
it 'applies' do
pp2 = <<-PUPPETCODE
PUPPETCODE
it 'throws an error' do
res = apply_manifest(pp1, expect_failures: true)
- expect(res[:exit_code]).to eql(0)
+ expect(res[:exit_code]).to be(0)
end
end
}
PUPPETCODE
it "changes the value to #{value}" do
- apply_manifest(pp1, catch_failures: true, )
+ apply_manifest(pp1, catch_failures: true)
apply_manifest(pp1, catch_changes: true)
run_shell('iptables-save -t raw') do |r|
PUPPETCODE
it 'applies cleanly' do
# Run it twice and test for idempotency
- r = apply_manifest(pp2, catch_failures: true, expect_failures: true)
-
- r=apply_manifest(pp2, catch_changes: true, expect_failures: true)
+ apply_manifest(pp2, catch_failures: true, expect_failures: true)
+ apply_manifest(pp2, catch_changes: true, expect_failures: true)
end
regex_values = [
end
end
end
-end
\ No newline at end of file
+end
options[:password] = node_config.dig('ssh', 'password') unless node_config.dig('ssh', 'password').nil?
options[:verify_host_key] = if node_config.dig('ssh', 'host-key-check').nil?
- # Fall back to SSH behavior. This variable will only be set in net-ssh 5.3+.
- if @strict_host_key_checking.nil? || @strict_host_key_checking
- Net::SSH::Verifiers::Always.new
- else
- # SSH's behavior with StrictHostKeyChecking=no: adds new keys to known_hosts.
- # If known_hosts points to /dev/null, then equivalent to :never where it
- # accepts any key beacuse they're all new.
- Net::SSH::Verifiers::AcceptNewOrLocalTunnel.new
- end
- elsif node_config.dig('ssh', 'host-key-check')
- if defined?(Net::SSH::Verifiers::Always)
- Net::SSH::Verifiers::Always.new
- else
- Net::SSH::Verifiers::Secure.new
- end
- elsif defined?(Net::SSH::Verifiers::Never)
- Net::SSH::Verifiers::Never.new
- else
- Net::SSH::Verifiers::Null.new
- end
+ # Fall back to SSH behavior. This variable will only be set in net-ssh 5.3+.
+ if @strict_host_key_checking.nil? || @strict_host_key_checking
+ Net::SSH::Verifiers::Always.new
+ else
+ # SSH's behavior with StrictHostKeyChecking=no: adds new keys to known_hosts.
+ # If known_hosts points to /dev/null, then equivalent to :never where it
+ # accepts any key beacuse they're all new.
+ Net::SSH::Verifiers::AcceptNewOrLocalTunnel.new
+ end
+ elsif node_config.dig('ssh', 'host-key-check')
+ if defined?(Net::SSH::Verifiers::Always)
+ Net::SSH::Verifiers::Always.new
+ else
+ Net::SSH::Verifiers::Secure.new
+ end
+ elsif defined?(Net::SSH::Verifiers::Never)
+ Net::SSH::Verifiers::Never.new
+ else
+ Net::SSH::Verifiers::Null.new
+ end
host = if ENV['TARGET_HOST'].include?(':')
ENV['TARGET_HOST'].split(':').first
end
end
-def get_iptables_version
- x=run_shell('iptables -V')
+def iptables_version
+ x = run_shell('iptables -V')
x.stdout.split(' ')[1][1..-1]
-end
\ No newline at end of file
+end