Skip to content
Snippets Groups Projects
Commit d0a05a08 authored by Mika Perälä's avatar Mika Perälä
Browse files

PDK update

parent 0dc89675
No related branches found
No related tags found
No related merge requests found
Pipeline #160896 passed
...@@ -31,9 +31,14 @@ indent_size = 4 ...@@ -31,9 +31,14 @@ indent_size = 4
[Makefile] [Makefile]
indent_style = tab indent_style = tab
; The JSON files contain newlines inconsistently
[*.json]
insert_final_newline = ignore
[*.{ps1,psm1}] [*.{ps1,psm1}]
indent_size = 4 indent_size = 4
# Ignore paths
[{LICENSE,REFERENCE.md}]
charset = unset
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_style = unset
indent_size = unset
...@@ -16,9 +16,10 @@ ...@@ -16,9 +16,10 @@
/log/ /log/
/pkg/ /pkg/
/spec/fixtures/manifests/ /spec/fixtures/manifests/
/spec/fixtures/modules/ /spec/fixtures/modules/*
/tmp/ /tmp/
/vendor/ /vendor/
/.vendor/
/convert_report.txt /convert_report.txt
/update_report.txt /update_report.txt
.DS_Store .DS_Store
...@@ -26,6 +27,12 @@ ...@@ -26,6 +27,12 @@
.envrc .envrc
/inventory.yaml /inventory.yaml
/spec/fixtures/litmus_inventory.yaml /spec/fixtures/litmus_inventory.yaml
.resource_types
.modules
.task_cache.json
.plan_cache.json
.rerun.json
bolt-debug.log
*~ *~
\#*\# \#*\#
.\#* .\#*
...@@ -2,3 +2,7 @@ ...@@ -2,3 +2,7 @@
include: include:
- project: 'puppet-infra/shared-ci-piplines' - project: 'puppet-infra/shared-ci-piplines'
file: '/puppet-module-pipeline.yaml' file: '/puppet-module-pipeline.yaml'
- local: .local-ci.yml
rules:
- exists:
- .local-ci.yml
...@@ -16,9 +16,10 @@ ...@@ -16,9 +16,10 @@
/log/ /log/
/pkg/ /pkg/
/spec/fixtures/manifests/ /spec/fixtures/manifests/
/spec/fixtures/modules/ /spec/fixtures/modules/*
/tmp/ /tmp/
/vendor/ /vendor/
/.vendor/
/convert_report.txt /convert_report.txt
/update_report.txt /update_report.txt
.DS_Store .DS_Store
...@@ -26,23 +27,26 @@ ...@@ -26,23 +27,26 @@
.envrc .envrc
/inventory.yaml /inventory.yaml
/spec/fixtures/litmus_inventory.yaml /spec/fixtures/litmus_inventory.yaml
.resource_types
.modules
.task_cache.json
.plan_cache.json
.rerun.json
bolt-debug.log
*~ *~
\#*\# \#*\#
.\#* .\#*
/appveyor.yml
/.editorconfig
/.fixtures.yml /.fixtures.yml
/Gemfile /Gemfile
/.gitattributes /.gitattributes
/.github/
/.gitignore /.gitignore
/.gitlab-ci.yml
/.pdkignore /.pdkignore
/.puppet-lint.rc /.puppet-lint.rc
/Rakefile /Rakefile
/rakelib/ /rakelib/
/.rspec /.rspec
/.rubocop.yml /..yml
/.travis.yml
/.yardopts /.yardopts
/spec/ /spec/
/.vscode/ /.vscode/
......
--relative --relative
--no-80chars-check
--no-lookup_in_parameter-check
--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp
...@@ -3,8 +3,9 @@ require: ...@@ -3,8 +3,9 @@ require:
- rubocop-performance - rubocop-performance
- rubocop-rspec - rubocop-rspec
AllCops: AllCops:
NewCops: enable
DisplayCopNames: true DisplayCopNames: true
TargetRubyVersion: '2.5' TargetRubyVersion: '2.6'
Include: Include:
- "**/*.rb" - "**/*.rb"
Exclude: Exclude:
...@@ -111,8 +112,14 @@ Style/MethodCalledOnDoEndBlock: ...@@ -111,8 +112,14 @@ Style/MethodCalledOnDoEndBlock:
Enabled: true Enabled: true
Style/StringMethods: Style/StringMethods:
Enabled: true Enabled: true
Bundler/GemFilename:
Enabled: false
Bundler/InsecureProtocolSource: Bundler/InsecureProtocolSource:
Enabled: false Enabled: false
Capybara/CurrentPathExpectation:
Enabled: false
Capybara/VisibilityMatcher:
Enabled: false
Gemspec/DuplicatedAssignment: Gemspec/DuplicatedAssignment:
Enabled: false Enabled: false
Gemspec/OrderedDependencies: Gemspec/OrderedDependencies:
...@@ -287,11 +294,9 @@ Performance/UriDefaultParser: ...@@ -287,11 +294,9 @@ Performance/UriDefaultParser:
Enabled: false Enabled: false
RSpec/Be: RSpec/Be:
Enabled: false Enabled: false
RSpec/Capybara/CurrentPathExpectation:
Enabled: false
RSpec/Capybara/FeatureMethods: RSpec/Capybara/FeatureMethods:
Enabled: false Enabled: false
RSpec/Capybara/VisibilityMatcher: RSpec/ContainExactly:
Enabled: false Enabled: false
RSpec/ContextMethod: RSpec/ContextMethod:
Enabled: false Enabled: false
...@@ -331,6 +336,8 @@ RSpec/LeakyConstantDeclaration: ...@@ -331,6 +336,8 @@ RSpec/LeakyConstantDeclaration:
Enabled: false Enabled: false
RSpec/LetBeforeExamples: RSpec/LetBeforeExamples:
Enabled: false Enabled: false
RSpec/MatchArray:
Enabled: false
RSpec/MissingExampleGroupArgument: RSpec/MissingExampleGroupArgument:
Enabled: false Enabled: false
RSpec/MultipleExpectations: RSpec/MultipleExpectations:
...@@ -373,8 +380,6 @@ Style/AccessModifierDeclarations: ...@@ -373,8 +380,6 @@ Style/AccessModifierDeclarations:
Enabled: false Enabled: false
Style/AccessorGrouping: Style/AccessorGrouping:
Enabled: false Enabled: false
Style/AsciiComments:
Enabled: false
Style/BisectedAttrAccessor: Style/BisectedAttrAccessor:
Enabled: false Enabled: false
Style/CaseLikeIf: Style/CaseLikeIf:
...@@ -485,35 +490,241 @@ Style/TrailingMethodEndStatement: ...@@ -485,35 +490,241 @@ Style/TrailingMethodEndStatement:
Enabled: false Enabled: false
Style/UnpackFirst: Style/UnpackFirst:
Enabled: false Enabled: false
Capybara/MatchStyle:
Enabled: false
Capybara/NegationMatcher:
Enabled: false
Capybara/SpecificActions:
Enabled: false
Capybara/SpecificFinders:
Enabled: false
Capybara/SpecificMatcher:
Enabled: false
Gemspec/DeprecatedAttributeAssignment:
Enabled: false
Gemspec/DevelopmentDependencies:
Enabled: false
Gemspec/RequireMFA:
Enabled: false
Layout/LineContinuationLeadingSpace:
Enabled: false
Layout/LineContinuationSpacing:
Enabled: false
Layout/LineEndStringConcatenationIndentation:
Enabled: false
Layout/SpaceBeforeBrackets:
Enabled: false
Lint/AmbiguousAssignment:
Enabled: false
Lint/AmbiguousOperatorPrecedence:
Enabled: false
Lint/AmbiguousRange:
Enabled: false
Lint/ConstantOverwrittenInRescue:
Enabled: false
Lint/DeprecatedConstants:
Enabled: false
Lint/DuplicateBranch: Lint/DuplicateBranch:
Enabled: false Enabled: false
Lint/DuplicateMagicComment:
Enabled: false
Lint/DuplicateMatchPattern:
Enabled: false
Lint/DuplicateRegexpCharacterClassElement: Lint/DuplicateRegexpCharacterClassElement:
Enabled: false Enabled: false
Lint/EmptyBlock: Lint/EmptyBlock:
Enabled: false Enabled: false
Lint/EmptyClass: Lint/EmptyClass:
Enabled: false Enabled: false
Lint/EmptyInPattern:
Enabled: false
Lint/IncompatibleIoSelectWithFiberScheduler:
Enabled: false
Lint/LambdaWithoutLiteralBlock:
Enabled: false
Lint/NoReturnInBeginEndBlocks: Lint/NoReturnInBeginEndBlocks:
Enabled: false Enabled: false
Lint/NonAtomicFileOperation:
Enabled: false
Lint/NumberedParameterAssignment:
Enabled: false
Lint/OrAssignmentToConstant:
Enabled: false
Lint/RedundantDirGlobSort:
Enabled: false
Lint/RefinementImportMethods:
Enabled: false
Lint/RequireRangeParentheses:
Enabled: false
Lint/RequireRelativeSelfPath:
Enabled: false
Lint/SymbolConversion:
Enabled: false
Lint/ToEnumArguments: Lint/ToEnumArguments:
Enabled: false Enabled: false
Lint/TripleQuotes:
Enabled: false
Lint/UnexpectedBlockArity: Lint/UnexpectedBlockArity:
Enabled: false Enabled: false
Lint/UnmodifiedReduceAccumulator: Lint/UnmodifiedReduceAccumulator:
Enabled: false Enabled: false
Lint/UselessRescue:
Enabled: false
Lint/UselessRuby2Keywords:
Enabled: false
Metrics/CollectionLiteralLength:
Enabled: false
Naming/BlockForwarding:
Enabled: false
Performance/CollectionLiteralInLoop: Performance/CollectionLiteralInLoop:
Enabled: false Enabled: false
Performance/ConcurrentMonotonicTime:
Enabled: false
Performance/MapCompact:
Enabled: false
Performance/RedundantEqualityComparisonBlock:
Enabled: false
Performance/RedundantSplitRegexpArgument:
Enabled: false
Performance/StringIdentifierArgument:
Enabled: false
RSpec/BeEq:
Enabled: false
RSpec/BeNil:
Enabled: false
RSpec/ChangeByZero:
Enabled: false
RSpec/ClassCheck:
Enabled: false
RSpec/DuplicatedMetadata:
Enabled: false
RSpec/ExcessiveDocstringSpacing:
Enabled: false
RSpec/FactoryBot/ConsistentParenthesesStyle:
Enabled: false
RSpec/FactoryBot/FactoryNameStyle:
Enabled: false
RSpec/FactoryBot/SyntaxMethods:
Enabled: false
RSpec/IdenticalEqualityAssertion:
Enabled: false
RSpec/NoExpectationExample:
Enabled: false
RSpec/PendingWithoutReason:
Enabled: false
RSpec/Rails/AvoidSetupHook:
Enabled: false
RSpec/Rails/HaveHttpStatus:
Enabled: false
RSpec/Rails/InferredSpecType:
Enabled: false
RSpec/Rails/MinitestAssertions:
Enabled: false
RSpec/Rails/TravelAround:
Enabled: false
RSpec/RedundantAround:
Enabled: false
RSpec/SkipBlockInsideExample:
Enabled: false
RSpec/SortMetadata:
Enabled: false
RSpec/SubjectDeclaration:
Enabled: false
RSpec/VerifiedDoubleReference:
Enabled: false
Security/CompoundHash:
Enabled: false
Security/IoMethods:
Enabled: false
Style/ArgumentsForwarding: Style/ArgumentsForwarding:
Enabled: false Enabled: false
Style/ArrayIntersect:
Enabled: false
Style/CollectionCompact: Style/CollectionCompact:
Enabled: false Enabled: false
Style/ComparableClamp:
Enabled: false
Style/ConcatArrayLiterals:
Enabled: false
Style/DataInheritance:
Enabled: false
Style/DirEmpty:
Enabled: false
Style/DocumentDynamicEvalDefinition: Style/DocumentDynamicEvalDefinition:
Enabled: false Enabled: false
Style/EmptyHeredoc:
Enabled: false
Style/EndlessMethod:
Enabled: false
Style/EnvHome:
Enabled: false
Style/FetchEnvVar:
Enabled: false
Style/FileEmpty:
Enabled: false
Style/FileRead:
Enabled: false
Style/FileWrite:
Enabled: false
Style/HashConversion:
Enabled: false
Style/HashExcept:
Enabled: false
Style/IfWithBooleanLiteralBranches:
Enabled: false
Style/InPatternThen:
Enabled: false
Style/MagicCommentFormat:
Enabled: false
Style/MapCompactWithConditionalBlock:
Enabled: false
Style/MapToHash:
Enabled: false
Style/MapToSet:
Enabled: false
Style/MinMaxComparison:
Enabled: false
Style/MultilineInPatternThen:
Enabled: false
Style/NegatedIfElseCondition: Style/NegatedIfElseCondition:
Enabled: false Enabled: false
Style/NestedFileDirname:
Enabled: false
Style/NilLambda: Style/NilLambda:
Enabled: false Enabled: false
Style/NumberedParameters:
Enabled: false
Style/NumberedParametersLimit:
Enabled: false
Style/ObjectThen:
Enabled: false
Style/OpenStructUse:
Enabled: false
Style/OperatorMethodCall:
Enabled: false
Style/QuotedSymbols:
Enabled: false
Style/RedundantArgument: Style/RedundantArgument:
Enabled: false Enabled: false
Style/RedundantConstantBase:
Enabled: false
Style/RedundantDoubleSplatHashBraces:
Enabled: false
Style/RedundantEach:
Enabled: false
Style/RedundantHeredocDelimiterQuotes:
Enabled: false
Style/RedundantInitialize:
Enabled: false
Style/RedundantLineContinuation:
Enabled: false
Style/RedundantSelfAssignmentBranch:
Enabled: false
Style/RedundantStringEscape:
Enabled: false
Style/SelectByRegexp:
Enabled: false
Style/StringChars:
Enabled: false
Style/SwapValues: Style/SwapValues:
Enabled: false Enabled: false
{ {
"recommendations": [ "recommendations": [
"puppet.puppet-vscode", "puppet.puppet-vscode",
"rebornix.Ruby",
"ms-vscode.powershell", "ms-vscode.powershell",
"EditorConfig.EditorConfig", "EditorConfig.EditorConfig",
"glenbuktenica.unicode-substitutions" "glenbuktenica.unicode-substitutions",
"Shopify.ruby-lsp"
] ]
} }
...@@ -13,29 +13,40 @@ def location_for(place_or_version, fake_version = nil) ...@@ -13,29 +13,40 @@ def location_for(place_or_version, fake_version = nil)
end end
end end
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')
group :development do 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 "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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "deep_merge", '~> 1.2.2', require: false
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
gem "puppet-lint-absolute_classname-check", '3.0.1', require: false gem "facterdb", '~> 2.1', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-lint-absolute_template_path", '1.0.1', require: false gem "facterdb", '~> 3.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-lint-empty_trailing_lines", '0.0.1', require: false gem "metadata-json-lint", '~> 4.0', require: false
gem "puppet-lint-file_ensure-check", '1.0.0', require: false gem "json-schema", '< 5.1.1', require: false
gem "puppet-lint-strict_indent-check", '2.0.8', require: false gem "rspec-puppet-facts", '~> 4.0', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-lint-trailing_comma-check", '0.4.2', require: false gem "rspec-puppet-facts", '~> 5.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-lint-unquoted_string-check", '2.1.0', require: false gem "dependency_checker", '~> 1.0.0', require: false
gem "parallel_tests", '= 3.12.1', require: false
gem "pry", '~> 0.10', require: false
gem "simplecov-console", '~> 0.9', require: false
gem "puppet-debugger", '~> 1.0', require: false
gem "rubocop", '~> 1.50.0', require: false
gem "rubocop-performance", '= 1.16.0', require: false
gem "rubocop-rspec", '= 2.19.0', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end
group :development, :release_prep do
gem "puppet-strings", '~> 4.0', require: false
gem "puppetlabs_spec_helper", '~> 8.0', require: false
gem "puppet-blacksmith", '~> 7.0', require: false
end end
group :system_tests do group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "serverspec", '~> 2.41', require: false
end end
puppet_version = ENV['PUPPET_GEM_VERSION'] puppet_version = ENV['PUPPET_GEM_VERSION']
......
# frozen_string_literal: true # frozen_string_literal: true
require 'bundler' require 'bundler'
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
require 'puppetlabs_spec_helper/rake_tasks' require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax' require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?
def changelog_user
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['author']
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator user:#{returnVal}"
returnVal
end
def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"
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
def changelog_future_release
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator future_release:#{returnVal}"
returnVal
end
PuppetLint.configuration.send('disable_relative') PuppetLint.configuration.send('disable_relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_lookup_in_parameter')
if Bundler.rubygems.find_name('github_changelog_generator').any? PuppetLint.configuration.fail_on_warnings = false
GitHubChangelogGenerator::RakeTask.new :changelog do |config| PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"]
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
config.user = "#{changelog_user}"
config.project = "#{changelog_project}"
config.future_release = "#{changelog_future_release}"
config.exclude_labels = ['maintenance']
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
config.add_pr_wo_labels = true
config.issues = false
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
config.configure_sections = {
"Changed" => {
"prefix" => "### Changed",
"labels" => ["backwards-incompatible"],
},
"Added" => {
"prefix" => "### Added",
"labels" => ["enhancement", "feature"],
},
"Fixed" => {
"prefix" => "### Fixed",
"labels" => ["bug", "documentation", "bugfix"],
},
}
end
else
desc 'Generate a Changelog from GitHub'
task :changelog do
raise <<EOM
The changelog tasks depends on recent features of the github_changelog_generator gem.
Please manually add it to your .sync.yml for now, and run `pdk update`:
---
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
version: '~> 1.15'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
EOM
end
end
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
"version_requirement": ">= 6.21.0 < 8.0.0" "version_requirement": ">= 6.21.0 < 8.0.0"
} }
], ],
"pdk-version": "2.5.0", "pdk-version": "3.4.0",
"template-url": "https://gitlab.it.liu.se/puppet-infra/pdk-templates.git#liu", "template-url": "https://gitlab.it.liu.se/puppet-infra/pdk-templates.git#liu",
"template-ref": "heads/liu-0-gcb718ad" "template-ref": "heads/liu-0-g967906f"
} }
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
# #
# Facts specified here will override the values provided by rspec-puppet-facts. # Facts specified here will override the values provided by rspec-puppet-facts.
--- ---
ipaddress: "172.16.254.254" networking:
ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" ip: "172.16.254.254"
ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
mac: "AA:AA:AA:AA:AA:AA"
is_pe: false is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA"
...@@ -28,15 +28,16 @@ default_fact_files.each do |f| ...@@ -28,15 +28,16 @@ default_fact_files.each do |f|
next unless File.exist?(f) && File.readable?(f) && File.size?(f) next unless File.exist?(f) && File.readable?(f) && File.size?(f)
begin begin
default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) require 'deep_merge'
rescue => e default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true))
rescue StandardError => e
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
end end
end end
# read default_facts and merge them over what is provided by facterdb # read default_facts and merge them over what is provided by facterdb
default_facts.each do |fact, value| default_facts.each do |fact, value|
add_custom_fact fact, value add_custom_fact fact, value, merge_facts: true
end end
RSpec.configure do |c| RSpec.configure do |c|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment