From e57a0f99e1573e86b392a7a56c8392abca5f5875 Mon Sep 17 00:00:00 2001 From: Rehan Mahmood Date: Tue, 15 Nov 2022 17:26:13 -0500 Subject: [PATCH] - Updated os support matrix. - Updated `pdk` templates. --- .devcontainer/README.md | 8 ++++++-- .puppet-lint.rc | 2 +- .rubocop.yml | 2 +- .sync.yml | 10 +++++++--- .travis.yml | 23 ++++++++++++++++------- Gemfile | 1 + Rakefile | 2 +- data/common.yaml | 5 +++++ manifests/fetch/theme.pp | 7 +++---- manifests/init.pp | 8 ++++---- manifests/install.pp | 5 ++--- manifests/plugins.pp | 13 +++++++------ manifests/profile.pp | 5 ++--- manifests/theme.pp | 7 +++---- metadata.json | 10 +++++----- pdk.yaml | 2 ++ 16 files changed, 66 insertions(+), 44 deletions(-) create mode 100644 pdk.yaml diff --git a/.devcontainer/README.md b/.devcontainer/README.md index cc4675e5..a7193616 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -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": [], diff --git a/.puppet-lint.rc b/.puppet-lint.rc index e5cc4f8d..7d5d95f9 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,2 +1,2 @@ ---fail-on-warnings --relative +--no-documentation-check diff --git a/.rubocop.yml b/.rubocop.yml index 8f782e74..31e8248f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ require: - rubocop-rspec AllCops: DisplayCopNames: true - TargetRubyVersion: '2.4' + TargetRubyVersion: '2.5' Include: - "**/*.rb" Exclude: diff --git a/.sync.yml b/.sync.yml index 4bbf6cc4..b492c444 100644 --- a/.sync.yml +++ b/.sync.yml @@ -24,6 +24,10 @@ 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: ubuntu2204-64 + collection: puppet7 + - set: ubuntu2204-64 + collection: puppet6 - set: ubuntu2004-64 collection: puppet7 - set: ubuntu2004-64 @@ -36,8 +40,6 @@ appveyor.yml: collection: puppet7 - set: ubuntu1604-64 collection: puppet6 - - set: ubuntu1404-64 - collection: puppet6 - set: debian11-64 collection: puppet7 - set: debian11-64 @@ -116,7 +118,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' diff --git a/.travis.yml b/.travis.yml index b7b96b40..cb1dc520 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ jobs: - bundler_args: --with system_tests dist: focal - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=ubuntu2004-64 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 @@ -40,7 +40,7 @@ jobs: - bundler_args: --with system_tests dist: focal - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu2004-64 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 @@ -49,7 +49,7 @@ jobs: - bundler_args: --with system_tests dist: focal - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=ubuntu1804-64 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 @@ -58,7 +58,7 @@ jobs: - bundler_args: --with system_tests dist: focal - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu1804-64 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 @@ -67,7 +67,7 @@ jobs: - bundler_args: --with system_tests dist: focal - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=ubuntu1604-64 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 @@ -76,7 +76,7 @@ jobs: - bundler_args: --with system_tests dist: focal - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu1604-64 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 @@ -85,7 +85,16 @@ jobs: - bundler_args: --with system_tests dist: focal - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_HYPERVISOR=docker BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu1404-64 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 + 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=ubuntu1604-64 BEAKER_TESTMODE=apply rvm: 2.5.7 script: bundle exec rake beaker services: docker diff --git a/Gemfile b/Gemfile index 405d33c1..a087d1c8 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Rakefile b/Rakefile index a1d96a93..24b54bfa 100644 --- a/Rakefile +++ b/Rakefile @@ -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? diff --git a/data/common.yaml b/data/common.yaml index 07df06a1..3e89eb63 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -2,3 +2,8 @@ ohmyzsh::source: 'https://github.com/ohmyzsh/ohmyzsh.git' ohmyzsh::home: '/home' ohmyzsh::zsh_shell_path: '/usr/bin/zsh' + +ohmyzsh::installs: {} +ohmyzsh::themes: {} +ohmyzsh::plugins: {} +ohmyzsh::profiles: {} diff --git a/manifests/fetch/theme.pp b/manifests/fetch/theme.pp index 298419b4..a525e53d 100644 --- a/manifests/fetch/theme.pp +++ b/manifests/fetch/theme.pp @@ -6,24 +6,23 @@ Optional[String] $revision = undef, Optional[Integer] $depth = undef, ) { - include ohmyzsh if $name == 'root' { - $home = '/root' + $home = '/root' $group = fact('os.family') ? { /(Free|Open)BSD/ => 'wheel', default => 'root', } } else { - $home = "${ohmyzsh::home}/${name}" + $home = "${ohmyzsh::home}/${name}" $group = $name } $themepath = "${home}/.oh-my-zsh/custom/themes" $fullpath = "${themepath}/${filename}" - if ! defined(File[$themepath]) { + if !defined(File[$themepath]) { file { $themepath: ensure => directory, owner => $name, diff --git a/manifests/init.pp b/manifests/init.pp index 0d97992c..a305ad90 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,10 +14,10 @@ Stdlib::Httpsurl $source, Stdlib::Absolutepath $home, Stdlib::Absolutepath $zsh_shell_path, - Hash $installs = lookup('ohmyzsh::installs', Hash, 'hash', {}), - Hash $themes = lookup('ohmyzsh::themes', Hash, 'hash', {}), - Hash $plugins = lookup('ohmyzsh::plugins', Hash, 'hash', {}), - Hash $profiles = lookup('ohmyzsh::profiles', Hash, 'hash', {}) + Hash $installs, + Hash $themes, + Hash $plugins, + Hash $profiles, ) { create_resources('ohmyzsh::install', $ohmyzsh::installs) create_resources('ohmyzsh::theme', $ohmyzsh::themes) diff --git a/manifests/install.pp b/manifests/install.pp index 7f352b17..b369039a 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -28,7 +28,6 @@ Boolean $disable_auto_update = false, Boolean $override_template = false, ) { - include ohmyzsh if !defined(Package['git']) { @@ -44,13 +43,13 @@ } if $name == 'root' { - $home = '/root' + $home = '/root' $group = fact('os.family') ? { /(Free|Open)BSD/ => 'wheel', default => 'root', } } else { - $home = "${ohmyzsh::home}/${name}" + $home = "${ohmyzsh::home}/${name}" $group = $name } diff --git a/manifests/plugins.pp b/manifests/plugins.pp index 6007f9f4..20d9d8a7 100644 --- a/manifests/plugins.pp +++ b/manifests/plugins.pp @@ -21,29 +21,30 @@ # # Copyright 2014 # -define ohmyzsh::plugins( +define ohmyzsh::plugins ( Array[String] $plugins = ['git'], Hash[String, - Struct[{ + Struct[ + { source => Enum[git], url => Stdlib::Httpsurl, ensure => Enum[present, latest], revision => Optional[String], depth => Optional[Integer] - }] + } + ] ] $custom_plugins = {}, ) { - include ohmyzsh if $name == 'root' { - $home = '/root' + $home = '/root' $group = fact('os.family') ? { /(Free|Open)BSD/ => 'wheel', default => 'root', } } else { - $home = "${ohmyzsh::home}/${name}" + $home = "${ohmyzsh::home}/${name}" $group = $name } diff --git a/manifests/profile.pp b/manifests/profile.pp index cc229ab0..7d973a02 100644 --- a/manifests/profile.pp +++ b/manifests/profile.pp @@ -15,17 +15,16 @@ define ohmyzsh::profile ( Hash $scripts = {}, ) { - include ohmyzsh if $name == 'root' { - $home = '/root' + $home = '/root' $group = fact('os.family') ? { /(Free|Open)BSD/ => 'wheel', default => 'root', } } else { - $home = "${ohmyzsh::home}/${name}" + $home = "${ohmyzsh::home}/${name}" $group = $name } diff --git a/manifests/theme.pp b/manifests/theme.pp index c81c045a..77c7979b 100644 --- a/manifests/theme.pp +++ b/manifests/theme.pp @@ -21,20 +21,19 @@ # # Copyright 2014 # -define ohmyzsh::theme( +define ohmyzsh::theme ( String $theme = 'clean', ) { - include ohmyzsh if $name == 'root' { - $home = '/root' + $home = '/root' $group = fact('os.family') ? { /(Free|Open)BSD/ => 'wheel', default => 'root', } } else { - $home = "${ohmyzsh::home}/${name}" + $home = "${ohmyzsh::home}/${name}" $group = $name } diff --git a/metadata.json b/metadata.json index f32750a4..96dcf405 100644 --- a/metadata.json +++ b/metadata.json @@ -72,10 +72,10 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "14.04", "16.04", "18.04", - "20.04" + "20.04", + "22.04" ] }, { @@ -104,7 +104,7 @@ "ohmyzsh", "oh-my-zsh" ], - "pdk-version": "2.4.0", - "template-url": "pdk-default#2.4.0", - "template-ref": "tags/2.4.0-0-gfa6b6d2" + "pdk-version": "2.5.0", + "template-url": "pdk-default#2.5.0", + "template-ref": "tags/2.5.0-0-g369d483" } diff --git a/pdk.yaml b/pdk.yaml new file mode 100644 index 00000000..4bef4bd0 --- /dev/null +++ b/pdk.yaml @@ -0,0 +1,2 @@ +--- +ignore: []