diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..9032a014 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +*.rb eol=lf +*.erb eol=lf +*.pp eol=lf +*.sh eol=lf +*.epp eol=lf diff --git a/.gitignore b/.gitignore index d9259022..3f155121 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,28 @@ +.git/ +.*.sw[op] +.metadata +.yardoc +.yardwarns +*.iml /.bundle/ -/.yardoc -/_yardoc/ +/.idea/ +/.vagrant/ /coverage/ +/bin/ /doc/ +/Gemfile.local +/Gemfile.lock +/junit/ +/log/ /pkg/ -/spec/reports/ +/spec/fixtures/manifests/ +/spec/fixtures/modules/* /tmp/ -/bin/ /vendor/ - -# rspec failure tracking -.rspec_status - -Gemfile.local -Gemfile.lock - -# build output -/ruby-pwsh-*.gem - -# Acceptance Testing fixtures -/spec/fixtures/modules/ -/spec/fixtures/test.pp -/spec/fixtures/website/ - -# Acceptance Testing files -*.tar.gz +/convert_report.txt +/update_report.txt +.DS_Store +.project +.envrc +/inventory.yaml +/spec/fixtures/litmus_inventory.yaml diff --git a/.pdkignore b/.pdkignore new file mode 100644 index 00000000..584438f9 --- /dev/null +++ b/.pdkignore @@ -0,0 +1,43 @@ +.git/ +.*.sw[op] +.metadata +.yardoc +.yardwarns +*.iml +/.bundle/ +/.idea/ +/.vagrant/ +/coverage/ +/bin/ +/doc/ +/Gemfile.local +/Gemfile.lock +/junit/ +/log/ +/pkg/ +/spec/fixtures/manifests/ +/spec/fixtures/modules/* +/tmp/ +/vendor/ +/convert_report.txt +/update_report.txt +.DS_Store +.project +.envrc +/inventory.yaml +/spec/fixtures/litmus_inventory.yaml +/.fixtures.yml +/Gemfile +/.gitattributes +/.gitignore +/.pdkignore +/.puppet-lint.rc +/Rakefile +/rakelib/ +/.rspec +/..yml +/.yardopts +/spec/ +/.vscode/ +/.sync.yml +/.devcontainer/ diff --git a/.puppet-lint.rc b/.puppet-lint.rc new file mode 100644 index 00000000..cc96ece0 --- /dev/null +++ b/.puppet-lint.rc @@ -0,0 +1 @@ +--relative diff --git a/.rspec b/.rspec index 34c5164d..16f9cdb0 100644 --- a/.rspec +++ b/.rspec @@ -1,3 +1,2 @@ ---format documentation --color ---require spec_helper +--format documentation diff --git a/.sync.yml b/.sync.yml new file mode 100644 index 00000000..115bd263 --- /dev/null +++ b/.sync.yml @@ -0,0 +1,19 @@ +--- +".gitlab-ci.yml": + delete: true +appveyor.yml: + delete: true +spec/spec_helper.rb: + unmanaged: true +.github/workflows/auto_release.yml: + unmanaged: true +.github/workflows/ci.yml: + unmanaged: true +.github/workflows/nightly.yml: + unmanaged: true +.github/workflows/release.yml: + unmanaged: true +.travis.yml: + delete: true +Rakefile: + unmanaged: true diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..2f1e4f73 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "puppet.puppet-vscode", + "rebornix.Ruby" + ] +} diff --git a/.yardopts b/.yardopts new file mode 100644 index 00000000..29c933bc --- /dev/null +++ b/.yardopts @@ -0,0 +1 @@ +--markup markdown diff --git a/Gemfile b/Gemfile index da16a92f..a5081fff 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,4 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' - -# Specify your gem's dependencies in pwsh.gemspec -gemspec +source ENV['GEM_SOURCE'] || 'https://rubygems.org' def location_for(place_or_version, fake_version = nil) git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} @@ -19,24 +14,61 @@ def location_for(place_or_version, fake_version = nil) end group :development do - gem 'faraday-retry' - gem 'fuubar' - gem 'pry' - gem 'pry-stack_explorer' - gem 'yard' + 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.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + 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 "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 "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 "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false + gem "facterdb", '~> 1.18', require: false + gem "metadata-json-lint", '~> 3.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false + gem "rspec-puppet-facts", '~> 2.0', require: false + gem "codecov", '~> 0.2', 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.5', require: false + gem "puppet-debugger", '~> 1.0', require: false + gem "rubocop", '= 1.48.1', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false + gem "puppet-strings", '~> 4.0', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] +end +group :system_tests do + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "serverspec", '~> 2.41', require: false end -group :test do - gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION']) - - gem 'ffi' - gem 'rake', '~> 13.0' - gem 'rspec', '~> 3.0' - gem 'rspec-collection_matchers', '~> 1.0' - gem 'rspec-its', '~> 1.0' - gem 'rubocop', '~> 1.48', require: false - gem 'rubocop-performance', '~> 1.16', require: false - gem 'rubocop-rspec', '~> 2.19', require: false - gem 'simplecov', require: false +puppet_version = ENV['PUPPET_GEM_VERSION'] +facter_version = ENV['FACTER_GEM_VERSION'] +hiera_version = ENV['HIERA_GEM_VERSION'] + +gems = {} + +gems['puppet'] = location_for(puppet_version) + +# If facter or hiera versions have been specified via the environment +# variables + +gems['facter'] = location_for(facter_version) if facter_version +gems['hiera'] = location_for(hiera_version) if hiera_version + +gems.each do |gem_name, gem_params| + gem gem_name, *gem_params end +# Evaluate Gemfile.local and ~/.gemfile if they exist +extra_gemfiles = [ + "#{__FILE__}.local", + File.join(Dir.home, '.gemfile'), +] + +extra_gemfiles.each do |gemfile| + if File.file?(gemfile) && File.readable?(gemfile) + eval(File.read(gemfile), binding) + end +end +# vim: syntax=ruby diff --git a/metadata.json b/metadata.json index 5db33b2d..53aaff2b 100644 --- a/metadata.json +++ b/metadata.json @@ -76,7 +76,7 @@ "version_requirement": ">= 6.0.0 < 8.0.0" } ], - "pdk-version": "1.13.0", - "template-url": "pdk-default#1.13.0", - "template-ref": "1.13.0-0-g66e1443" + "pdk-version": "3.0.0", + "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", + "template-ref": "tags/3.0.0-0-g5bfc1c0" } diff --git a/spec/default_facts.yml b/spec/default_facts.yml new file mode 100644 index 00000000..3346c394 --- /dev/null +++ b/spec/default_facts.yml @@ -0,0 +1,9 @@ +# Use default_module_facts.yml for module specific facts. +# +# Facts specified here will override the values provided by rspec-puppet-facts. +--- +networking: + ip: "172.16.254.254" + ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" + mac: "AA:AA:AA:AA:AA:AA" +is_pe: false