Skip to content

Commit

Permalink
Merge pull request #35 from rehanone/develop/pdk-update
Browse files Browse the repository at this point in the history
- Updated os support matrix.
  • Loading branch information
rehanone authored Dec 7, 2022
2 parents a110dab + 335031a commit 750b037
Show file tree
Hide file tree
Showing 26 changed files with 178 additions and 195 deletions.
8 changes: 6 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/pupp

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"puppet.puppet-vscode",
"rebornix.Ruby"
]
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [],
Expand Down
3 changes: 1 addition & 2 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
--fail-on-warnings
--relative
--no-140chars-check
--no-documentation-check
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require:
- rubocop-rspec
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.4'
TargetRubyVersion: '2.5'
Include:
- "**/*.rb"
Exclude:
Expand Down
63 changes: 52 additions & 11 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,57 @@ appveyor.yml:
user: rehanone
secure: "WiS9j4aI93DobVH/O/z6aHKOY8UL2hwn4+fflKuhvZzJPxfsYYfvQsyX43qetpVAIW7DCZLfO1QQlLF1/ywhe8Y9XRy923R6E7WckYPCGtGBpeTdS7p3Biss2H+ikxI9/5UFlewrdFxLxqgKz8lGLCt8zL1r7ggPWjJBfWEBtk2J9mj4BRTTGt6SWTSHwkdqjloQsPu32SXWY4nsU+87p+lO49YTOH2cS+54/DRCpccPl2AL+kXISDGiDZtlMyGdL2c0Z1e8etmOxbHN2X80YyOQY2GiKdGhzVfx5TDPElDXkOO5JkkZWmsz2D6BJYvu+s9awIJ6/pzGFDghZIK2MSgfUjJd9Vwt1lm48kHKsJ3DsSRIOHK+2ft/3nUl8y7j7KKQMcKKVN35/0uy/cXnD4acuxCh84e5bc0pmYy0gxLhLF6C9Ahv8pls7HhA+jaoUBNXIgCb685w6EgrkaeGMx1vz7VfZo56viod/zZ7XCXg8o5s7vthKMtYLnuGIEl2DvBC3KKtGvl4RnzFVUcZcB5lHgLZozskcwuWFtqd/AgqdIVRzKc6KmRWo8TkE/qOV79MaUpKGONmLMQfsz01HMn4m/NAmu4J55kFgFYkrkwy+9c/3Z9Ytce7goOnyxYYd0fFfaSM8vJCl7oe8Zb3znK2atMmpQAfDwYBwUNe1jU="
docker_sets:
- set: docker/ubuntu-20.04
- set: docker/ubuntu-18.04
- set: docker/ubuntu-16.04
- set: docker/ubuntu-14.04
- set: docker/debian-10
- set: docker/debian-9
- set: docker/debian-8
- set: docker/centos-8
- set: docker/centos-7
- set: docker/opensuse-15
- set: ubuntu2204-64
collection: puppet7
- set: ubuntu2204-64
collection: puppet6
- set: ubuntu2004-64
collection: puppet7
- set: ubuntu2004-64
collection: puppet6
- set: ubuntu1804-64
collection: puppet7
- set: ubuntu1804-64
collection: puppet6
- set: ubuntu1604-64
collection: puppet7
- set: ubuntu1604-64
collection: puppet6
- set: debian11-64
collection: puppet7
- set: debian11-64
collection: puppet6
- set: debian10-64
collection: puppet7
- set: debian10-64
collection: puppet6
- set: debian9-64
collection: puppet7
- set: debian9-64
collection: puppet6
# - set: almalinux9-64
# collection: puppet7
# - set: almalinux9-64
# collection: puppet6
- set: almalinux8-64
collection: puppet7
- set: almalinux8-64
collection: puppet6
# - set: rockylinux9-64
# collection: puppet7
# - set: rockylinux9-64
# collection: puppet6
# - set: rockylinux8-64
# collection: puppet7
# - set: rockylinux8-64
# collection: puppet6
# - set: opensuse15-64
# collection: puppet7
# - set: opensuse15-64
# collection: puppet6
docker_defaults:
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=@@COLLECTION@@ BEAKER_setfile=@@SET@@ BEAKER_TESTMODE=@@TESTMODE@@
branches:
- master
remove_branches:
Expand Down Expand Up @@ -85,7 +124,9 @@ Gemfile:
- gem: 'beaker-docker'

Rakefile:
linter_fail_on_warnings: true
linter_fail_on_warnings: false
extra_disabled_lint_checks:
- 'documentation'

spec/spec_helper.rb:
mock_with: ':rspec'
Expand Down
74 changes: 64 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-20.04 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=ubuntu2204-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand All @@ -40,7 +40,7 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-18.04 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu2204-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand All @@ -49,7 +49,7 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-16.04 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=ubuntu2004-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand All @@ -58,7 +58,7 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu2004-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand All @@ -67,7 +67,7 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/debian-10 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=ubuntu1804-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand All @@ -76,7 +76,7 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/debian-9 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu1804-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand All @@ -85,7 +85,7 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/debian-8 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=ubuntu1604-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand All @@ -94,7 +94,7 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-8 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu1604-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand All @@ -103,7 +103,7 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand All @@ -112,7 +112,61 @@ jobs:
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/opensuse-15 BEAKER_TESTMODE=apply
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=debian11-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
stage: acceptance
sudo: required
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian10-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
stage: acceptance
sudo: required
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=debian10-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
stage: acceptance
sudo: required
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian9-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
stage: acceptance
sudo: required
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=debian9-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
stage: acceptance
sudo: required
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=almalinux8-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
stage: acceptance
sudo: required
-
bundler_args: --with system_tests
dist: focal
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=almalinux8-64 BEAKER_TESTMODE=apply
rvm: 2.5.7
script: bundle exec rake beaker
services: docker
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ group :development do
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false
gem "puppet-lint-absolute_template_path", require: false
gem "puppet-lint-absolute_classname-check", require: false
gem "puppet-lint-alias-check", require: false
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def changelog_future_release
end

PuppetLint.configuration.send('disable_relative')
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('disable_documentation')


if Bundler.rubygems.find_name('github_changelog_generator').any?
Expand Down
38 changes: 38 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.box = "bento/ubuntu-22.04"
config.vm.box_url = "https://app.vagrantup.com/bento/boxes/ubuntu-22.04"

config.vm.synced_folder ".", "/etc/puppetlabs/code/environments/production/modules/jq"

config.vm.provision :shell, inline: <<-EOF
readonly source_file="puppet7-release-jammy.deb"
readonly source_url="https://apt.puppetlabs.com/"
if [ -f ${source_file} ]; then
echo "File ${source_file} exists."
else
echo "File ${source_file} does not exist."
echo "Downloading it from ${source_url}${source_file}"
apt-get install -y wget
wget ${source_url}${source_file}
dpkg -i ${source_file}
apt-get update
apt-get install -y puppet-agent
fi
puppet module install puppetlabs/stdlib
EOF

config.vm.provision :puppet do |puppet|
puppet.manifests_path = "examples"
puppet.manifest_file = "init.pp"
# puppet.module_path = ["."]
# puppet.options = "../"
# puppet.options = "--verbose --debug"
end
end
1 change: 0 additions & 1 deletion examples/init.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node default {

notify { 'enduser-before': }
notify { 'enduser-after': }

Expand Down
1 change: 0 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# config.pp

class wget::config () inherits wget {

assert_private("Use of private class ${name} by ${caller_module_name}")

create_resources('wget::retrieve', $wget::retrievals)
Expand Down
5 changes: 2 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# init.pp

# Class wget
#
class wget (
Boolean $package_manage,
String $package_ensure,
String $package_name,
Hash[String, Hash[String, String]] $retrievals = lookup('wget::retrievals', Hash, 'hash', {}),
) {

anchor { "${module_name}::begin": }
-> class { "${module_name}::install": }
-> class { "${module_name}::config": }
Expand Down
1 change: 0 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# install.pp

class wget::install inherits wget {

assert_private("Use of private class ${name} by ${caller_module_name}")

if $wget::package_manage {
Expand Down
8 changes: 3 additions & 5 deletions manifests/retrieve.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
Optional[Stdlib::Httpurl] $http_proxy = undef,
Optional[Stdlib::Httpsurl] $https_proxy = undef,
) {

# Does $destination end in a slash? If so, treat as a directory
case $destination {
# This is a nasty looking regex but it's simply checking to see if the $destination
Expand All @@ -40,15 +39,15 @@

$http_proxy_env = $http_proxy ? {
undef => [],
default => [ "HTTP_PROXY=${http_proxy}", "http_proxy=${http_proxy}" ],
default => ["HTTP_PROXY=${http_proxy}", "http_proxy=${http_proxy}"],
}
$https_proxy_env = $https_proxy ? {
undef => [],
default => [ "HTTPS_PROXY=${https_proxy}", "https_proxy=${https_proxy}" ],
default => ["HTTPS_PROXY=${https_proxy}", "https_proxy=${https_proxy}"],
}
$password_env = $user ? {
undef => [],
default => [ "WGETRC=${_destination}.wgetrc" ],
default => ["WGETRC=${_destination}.wgetrc"],
}

# not using stdlib.concat to avoid extra dependency
Expand Down Expand Up @@ -142,7 +141,6 @@
}
}


if !defined('wget') {
contain wget
}
Expand Down
Loading

0 comments on commit 750b037

Please sign in to comment.