From ac81ee6eb6abd34a44e04ac810444e016fade5d3 Mon Sep 17 00:00:00 2001 From: David Swan Date: Tue, 4 Aug 2020 15:42:40 +0100 Subject: [PATCH 1/7] (IAC-973) - Update travis/appveyor to run on new default branch main --- .travis.yml | 32 +++++++++++++++++++++++++++----- Rakefile | 13 ++++++------- appveyor.yml | 2 +- metadata.json | 4 ++-- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 30150baf..87c9c6ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,11 +40,11 @@ jobs: stage: acceptance - before_script: - - "bundle exec rake 'litmus:provision_list[travis_el7]'" + - "bundle exec rake 'litmus:provision_list[travis_el]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" bundler_args: - env: PLATFORMS=travis_el7_puppet5 + env: PLATFORMS=travis_el_puppet5 rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker @@ -60,6 +60,17 @@ jobs: script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance + - + before_script: + - "bundle exec rake 'litmus:provision_list[travis_el7]'" + - "bundle exec rake 'litmus:install_agent[puppet5]'" + - "bundle exec rake litmus:install_module" + bundler_args: + env: PLATFORMS=travis_el7_puppet5 + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] + services: docker + stage: acceptance - before_script: - "bundle exec rake 'litmus:provision_list[travis_deb]'" @@ -73,11 +84,11 @@ jobs: stage: acceptance - before_script: - - "bundle exec rake 'litmus:provision_list[travis_el7]'" + - "bundle exec rake 'litmus:provision_list[travis_el]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" bundler_args: - env: PLATFORMS=travis_el7_puppet6 + env: PLATFORMS=travis_el_puppet6 rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker @@ -93,6 +104,17 @@ jobs: script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance + - + before_script: + - "bundle exec rake 'litmus:provision_list[travis_el7]'" + - "bundle exec rake 'litmus:install_agent[puppet6]'" + - "bundle exec rake litmus:install_module" + bundler_args: + env: PLATFORMS=travis_el7_puppet6 + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] + services: docker + stage: acceptance - env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint" stage: static @@ -118,7 +140,7 @@ jobs: stage: acceptance branches: only: - - master + - main - /^v\d/ notifications: email: false diff --git a/Rakefile b/Rakefile index cb7ed0cc..0a5093b3 100644 --- a/Rakefile +++ b/Rakefile @@ -52,7 +52,7 @@ if Bundler.rubygems.find_name('github_changelog_generator').any? 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; GO LABEL THEM" + config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB" config.configure_sections = { "Changed" => { "prefix" => "### Changed", @@ -60,11 +60,11 @@ if Bundler.rubygems.find_name('github_changelog_generator').any? }, "Added" => { "prefix" => "### Added", - "labels" => ["feature", "enhancement"], + "labels" => ["enhancement", "feature"], }, "Fixed" => { "prefix" => "### Fixed", - "labels" => ["bugfix"], + "labels" => ["bug", "documentation", "bugfix"], }, } end @@ -72,16 +72,15 @@ else desc 'Generate a Changelog from GitHub' task :changelog do raise <= Gem::Version.new('2.2.2')" + version: '~> 1.15' + condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')" EOM end end diff --git a/appveyor.yml b/appveyor.yml index e4f2e745..eb3dcfbf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,7 @@ version: 1.1.x.{build} branches: only: - - master + - main - release skip_commits: message: /^\(?doc\)?.*/ diff --git a/metadata.json b/metadata.json index 55595cde..403c0c05 100644 --- a/metadata.json +++ b/metadata.json @@ -80,7 +80,7 @@ "version_requirement": ">= 5.5.0 < 7.0.0" } ], - "pdk-version": "1.18.0", + "pdk-version": "1.18.1", "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-g9c14433" + "template-ref": "heads/master-0-gd610ead" } From 0234bc456bfd56dbd4a7c8c85a38373a779ad514 Mon Sep 17 00:00:00 2001 From: David Swan Date: Fri, 7 Aug 2020 12:38:43 +0100 Subject: [PATCH 2/7] (maint) - travis fix --- .sync.yml | 1 + .travis.yml | 22 ---------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/.sync.yml b/.sync.yml index b0b21a79..b9dac96d 100644 --- a/.sync.yml +++ b/.sync.yml @@ -13,6 +13,7 @@ use_litmus: true litmus: provision_list: + - ---travis_el - travis_deb - travis_ub - travis_el7 diff --git a/.travis.yml b/.travis.yml index 87c9c6ad..dffd0cf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,17 +38,6 @@ jobs: script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - - before_script: - - "bundle exec rake 'litmus:provision_list[travis_el]'" - - "bundle exec rake 'litmus:install_agent[puppet5]'" - - "bundle exec rake litmus:install_module" - bundler_args: - env: PLATFORMS=travis_el_puppet5 - rvm: 2.5.7 - script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] - services: docker - stage: acceptance - before_script: - "bundle exec rake 'litmus:provision_list[travis_ub]'" @@ -82,17 +71,6 @@ jobs: script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - - before_script: - - "bundle exec rake 'litmus:provision_list[travis_el]'" - - "bundle exec rake 'litmus:install_agent[puppet6]'" - - "bundle exec rake litmus:install_module" - bundler_args: - env: PLATFORMS=travis_el_puppet6 - rvm: 2.5.7 - script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] - services: docker - stage: acceptance - before_script: - "bundle exec rake 'litmus:provision_list[travis_ub]'" From e2c2671c7f66deb64e736c91fa51d0884f57384b Mon Sep 17 00:00:00 2001 From: David Swan Date: Tue, 10 Nov 2020 10:05:14 +0000 Subject: [PATCH 3/7] (IAC1001) - Removal of inappropriate terminology Removal of any inappropriate or offensive terminology from the codebase. --- .github/pull_request_template.md | 4 ++-- .github/workflows/release.yml | 4 ++-- CHANGELOG.md | 2 +- CONTRIBUTING.md | 2 +- HISTORY.md | 2 +- metadata.json | 4 ++-- spec/fixtures/scripts/install_pwsh/windows.ps1 | 1 + 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 49554d91..100430f7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,13 +3,13 @@ BEFORE YOU CREATE A PULL REQUEST: Ensure you have read over -CONTRIBUTING - https://github.com/puppetlabs/puppetlabs-powershell/blob/master/CONTRIBUTING.md +CONTRIBUTING - https://github.com/puppetlabs/puppetlabs-powershell/blob/main/CONTRIBUTING.md We provide defined guidance (as such, we strongly adhere to it). A summary of our expectations: - A ticket was created at https://tickets.puppetlabs.com/secure/CreateIssueDetails!init.jspa?pid=10707&issuetype=1&components=12015&summary=%5BPOWERSHELL%5D%20, or you have an existing ticket # - - You are not submitting a pull request from your MASTER branch. + - You are not submitting a pull request from your MAIN branch. - The first line of your git commit message has the ticket # and a short summary of the fix, followed by a detailed explanation of the fix in the git commit body. - Your git commit message format is important. We have a very defined expectation for this format and are keep to it. Really, READ the entire Contributing document. It will save you and us time. - Do not reformat code, it makes it hard to see what has changed. Leave the formatting to us. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dacc2ff7..43f4754e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Litmus Parallel - uses: puppetlabs/action-litmus_parallel@master + uses: puppetlabs/action-litmus_parallel@main with: platform: ${{ matrix.platform }} agent_family: ${{ matrix.agent_family }} @@ -37,7 +37,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Spec Tests - uses: puppetlabs/action-litmus_spec@master + uses: puppetlabs/action-litmus_spec@main with: puppet_gem_version: ${{ matrix.puppet_gem_version }} check: ${{ matrix.check }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e2a48ba5..5398545f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -218,7 +218,7 @@ All notable changes to this project will be documented in this file. The format - Fixed issue with metadata and PE version requirement -[Unreleased]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.3.0...master +[Unreleased]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.3.0...main [2.3.0]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.2.0...2.3.0 [2.2.0]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.1.5...2.2.0 [2.1.5]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.1.4...2.1.5 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a9fb3a5..9c171f99 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,7 +108,7 @@ process as easy as possible. To submit your changes via a GitHub pull request, we _highly_ recommend that you have them on a topic branch, instead of - directly on "master". + directly on "main". It makes things much easier to keep track of, especially if you decide to work on another thing before your first change is merged in. diff --git a/HISTORY.md b/HISTORY.md index f1b53983..2c4bdfc1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -177,7 +177,7 @@ - Fixed issue with metadata and PE version requirement -[Unreleased]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.3.0...master +[Unreleased]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.3.0...main [2.3.0]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.2.0...2.3.0 [2.2.0]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.1.5...2.2.0 [2.1.5]: https://github.com/puppetlabs/puppetlabs-powershell/compare/2.1.4...2.1.5 diff --git a/metadata.json b/metadata.json index 403c0c05..50d74ed0 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "pdk-version": "1.18.1", - "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-gd610ead" + "template-url": "https://github.com/puppetlabs/pdk-templates#main", + "template-ref": "heads/main-0-gd610ead" } diff --git a/spec/fixtures/scripts/install_pwsh/windows.ps1 b/spec/fixtures/scripts/install_pwsh/windows.ps1 index 19ce5caf..213cbd02 100644 --- a/spec/fixtures/scripts/install_pwsh/windows.ps1 +++ b/spec/fixtures/scripts/install_pwsh/windows.ps1 @@ -1,4 +1,5 @@ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +# Replace the below `master` reference when possible Invoke-WebRequest -Uri https://github.com/PowerShell/PowerShell/raw/master/tools/install-powershell.ps1 -UseBasicParsing -OutFile install-pwsh.ps1 & ./install-pwsh.ps1 -AddToPath From 0b75699a9dc14f75fcba6f6d88800428cb7a1bb1 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Tue, 17 Nov 2020 21:22:27 +0000 Subject: [PATCH 4/7] Update pdk-templates for gitpod and codespaces support --- .devcontainer/Dockerfile | 6 ++++++ .devcontainer/devcontainer.json | 23 +++++++++++++++++++++++ .gitpod.Dockerfile | 18 ++++++++++++++++++ .gitpod.yml | 9 +++++++++ .pdkignore | 2 ++ .sync.yml | 4 ++++ Gemfile | 1 + data/common.yaml | 1 + hiera.yaml | 21 +++++++++++++++++++++ metadata.json | 2 +- 10 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml create mode 100644 data/common.yaml create mode 100644 hiera.yaml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..12ed4ff1 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,6 @@ +FROM puppet/pdk:latest + +# [Optional] Uncomment this section to install additional packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..f1a55dc3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,23 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet +{ + "name": "Puppet Development Kit (Community)", + "dockerFile": "Dockerfile", + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/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": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "pdk --version", +} diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 00000000..0814c5e6 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,18 @@ +FROM gitpod/workspace-full +RUN sudo wget https://apt.puppet.com/puppet-tools-release-bionic.deb && \ + wget https://apt.puppetlabs.com/puppet6-release-bionic.deb && \ + sudo dpkg -i puppet6-release-bionic.deb && \ + sudo dpkg -i puppet-tools-release-bionic.deb && \ + sudo apt-get update && \ + sudo apt-get install -y pdk zsh puppet-agent && \ + sudo apt-get clean && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo usermod -s $(which zsh) gitpod && \ + sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \ + echo "plugins=(git gitignore github gem pip bundler python ruby docker docker-compose)" >> /home/gitpod/.zshrc && \ + echo 'PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin"' >> /home/gitpod/.zshrc && \ + sudo /opt/puppetlabs/puppet/bin/gem install puppet-debugger hub -N && \ + mkdir -p /home/gitpod/.config/puppet && \ + /opt/puppetlabs/puppet/bin/ruby -r yaml -e "puts ({'disabled' => true}).to_yaml" > /home/gitpod/.config/puppet/analytics.yml +RUN rm -f puppet6-release-bionic.deb puppet-tools-release-bionic.deb +ENTRYPOINT /usr/bin/zsh diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000..18406c50 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,9 @@ +image: + file: .gitpod.Dockerfile + +tasks: + - init: pdk bundle install + +vscode: + extensions: + - puppet.puppet-vscode@1.0.0:oSzfTkDf6Cmc1jOjgW33VA== diff --git a/.pdkignore b/.pdkignore index e6215cd0..254808c8 100644 --- a/.pdkignore +++ b/.pdkignore @@ -32,6 +32,7 @@ /.gitignore /.gitlab-ci.yml /.pdkignore +/.puppet-lint.rc /Rakefile /rakelib/ /.rspec @@ -40,3 +41,4 @@ /.yardopts /spec/ /.vscode/ +/.sync.yml diff --git a/.sync.yml b/.sync.yml index b9dac96d..d32702bb 100644 --- a/.sync.yml +++ b/.sync.yml @@ -59,3 +59,7 @@ Gemfile: condition: Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2') spec/spec_helper.rb: coverage_report: true +.gitpod.Dockerfile: + unmanaged: false +.gitpod.yml: + unmanaged: false diff --git a/Gemfile b/Gemfile index 3378919b..1202a551 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,7 @@ group :development do gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9') 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.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby] gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby] diff --git a/data/common.yaml b/data/common.yaml new file mode 100644 index 00000000..2fbf0ffd --- /dev/null +++ b/data/common.yaml @@ -0,0 +1 @@ +--- {} diff --git a/hiera.yaml b/hiera.yaml new file mode 100644 index 00000000..545fff32 --- /dev/null +++ b/hiera.yaml @@ -0,0 +1,21 @@ +--- +version: 5 + +defaults: # Used for any hierarchy level that omits these keys. + datadir: data # This path is relative to hiera.yaml's directory. + data_hash: yaml_data # Use the built-in YAML backend. + +hierarchy: + - name: "osfamily/major release" + paths: + # Used to distinguish between Debian and Ubuntu + - "os/%{facts.os.name}/%{facts.os.release.major}.yaml" + - "os/%{facts.os.family}/%{facts.os.release.major}.yaml" + # Used for Solaris + - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml" + - name: "osfamily" + paths: + - "os/%{facts.os.name}.yaml" + - "os/%{facts.os.family}.yaml" + - name: 'common' + path: 'common.yaml' diff --git a/metadata.json b/metadata.json index 50d74ed0..3ee145cb 100644 --- a/metadata.json +++ b/metadata.json @@ -82,5 +82,5 @@ ], "pdk-version": "1.18.1", "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-gd610ead" + "template-ref": "heads/main-0-g874030e" } From ebc1b27f48776fb2983fd3d331d646d1f1598a4b Mon Sep 17 00:00:00 2001 From: Ciaran McCrisken Date: Wed, 25 Nov 2020 13:28:27 +0000 Subject: [PATCH 5/7] (maint) Add release_checks_7 config to provision.yaml --- provision.yaml | 58 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/provision.yaml b/provision.yaml index 99bc1752..048af121 100644 --- a/provision.yaml +++ b/provision.yaml @@ -1,22 +1,60 @@ --- default: provisioner: docker - images: ['waffleimage/ubuntu18.04', 'waffleimage/centos7'] + images: + - waffleimage/ubuntu18.04 + - waffleimage/centos7 vagrant: provisioner: vagrant - images: ['centos/7', 'generic/ubuntu1804', 'generic/debian8', 'gusztavvargadr/windows-server'] + images: + - centos/7 + - generic/ubuntu1804 + - generic/debian8 + - gusztavvargadr/windows-server travis_deb: - provisioner: docker - images: ['litmusimage/debian:8', 'litmusimage/debian:9', 'litmusimage/debian:10'] + provisioner: docker + images: + - litmusimage/debian:8 + - litmusimage/debian:9 + - litmusimage/debian:10 travis_ub: - provisioner: docker - images: ['litmusimage/ubuntu:16.04', 'litmusimage/ubuntu:18.04'] + provisioner: docker + images: + - litmusimage/ubuntu:16.04 + - litmusimage/ubuntu:18.04 travis_el6: - provisioner: docker + provisioner: docker images: [] travis_el7: - provisioner: docker - images: ['litmusimage/centos:7'] + provisioner: docker + images: + - litmusimage/centos:7 release_checks: provisioner: abs - images: ['redhat-7-x86_64', 'redhat-8-x86_64', 'centos-7-x86_64', 'centos-8-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64', 'win-2012r2-x86_64', 'win-2016-core-x86_64', 'win-2019-core-x86_64'] + images: + - redhat-7-x86_64 + - redhat-8-x86_64 + - centos-7-x86_64 + - centos-8-x86_64 + - debian-8-x86_64 + - debian-9-x86_64 + - debian-10-x86_64 + - ubuntu-1604-x86_64 + - ubuntu-1804-x86_64 + - win-2012r2-x86_64 + - win-2016-core-x86_64 + - win-2019-core-x86_64 +release_checks_7: + provisioner: abs + images: + - win-2012r2-x86_64 + - win-2016-core-x86_64 + - win-2019-core-x86_64 + - win-10-pro-x86_64 + - centos-7-x86_64 + - centos-8-x86_64 + - debian-9-x86_64 + - debian-10-x86_64 + - redhat-7-x86_64 + - redhat-8-x86_64 + - ubuntu-1804-x86_64 From 1fca4c41c605bd4aa054512caca351e6a5756480 Mon Sep 17 00:00:00 2001 From: Michael T Lombardi Date: Mon, 30 Nov 2020 21:51:14 -0600 Subject: [PATCH 6/7] (MODULES-10722) Inherit pipe_timeout from timeout Prior to this commit there was no way to modify the pipe_timeout parameter when instantiating a PowerShell Manager instance, users were stuck with the default defined in ruby-pwsh (30s). If this time is insufficient to start the host process, the exec failed with no way to extend it short of modifying the provider. This commit updates the definition of the ps_manager by checking to see if the timeout parameter is specified on the resource and, if so, inheriting that to re-use for the pipe timeout. --- lib/puppet/provider/exec/powershell.rb | 6 +++--- lib/puppet/provider/exec/pwsh.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/puppet/provider/exec/powershell.rb b/lib/puppet/provider/exec/powershell.rb index 881fd4ab..3fab17fa 100644 --- a/lib/puppet/provider/exec/powershell.rb +++ b/lib/puppet/provider/exec/powershell.rb @@ -45,9 +45,9 @@ def self.upgrade_message @upgrade_warning_issued = true end - def ps_manager + def ps_manager(pipe_timeout) debug_output = Puppet::Util::Log.level == :debug - Pwsh::Manager.instance(Pwsh::Manager.powershell_path, Pwsh::Manager.powershell_args, debug: debug_output) + Pwsh::Manager.instance(Pwsh::Manager.powershell_path, Pwsh::Manager.powershell_args, debug: debug_output, pipe_timeout: pipe_timeout) end def run(command, check = false) @@ -77,7 +77,7 @@ def execute_resource(powershell_code, resource) timeout_ms = resource[:timeout].nil? ? nil : resource[:timeout] * 1000 environment_variables = resource[:environment].nil? ? [] : resource[:environment] - result = ps_manager.execute(powershell_code, timeout_ms, working_dir, environment_variables) + result = ps_manager(resource[:timeout]).execute(powershell_code, timeout_ms, working_dir, environment_variables) stdout = result[:stdout] native_out = result[:native_stdout] stderr = result[:stderr] diff --git a/lib/puppet/provider/exec/pwsh.rb b/lib/puppet/provider/exec/pwsh.rb index 4ebc859b..f51dbcb1 100644 --- a/lib/puppet/provider/exec/pwsh.rb +++ b/lib/puppet/provider/exec/pwsh.rb @@ -68,9 +68,9 @@ def pwsh_args # # @api private # @return [Pwsh::Manager] The PowerShell manager for this resource - def ps_manager + def ps_manager(pipe_timeout) debug_output = Puppet::Util::Log.level == :debug - Pwsh::Manager.instance(@pwsh, pwsh_args, debug: debug_output) + Pwsh::Manager.instance(@pwsh, pwsh_args, debug: debug_output, pipe_timeout: pipe_timeout) end def execute_resource(powershell_code, resource) @@ -81,7 +81,7 @@ def execute_resource(powershell_code, resource) timeout_ms = resource[:timeout].nil? ? nil : resource[:timeout] * 1000 environment_variables = resource[:environment].nil? ? [] : resource[:environment] - result = ps_manager.execute(powershell_code, timeout_ms, working_dir, environment_variables) + result = ps_manager(resource[:timeout]).execute(powershell_code, timeout_ms, working_dir, environment_variables) stdout = result[:stdout] native_out = result[:native_stdout] stderr = result[:stderr] From 1716ada1756a2ee2fffc36abb91df0e9061e6753 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Mon, 7 Dec 2020 17:23:48 +0200 Subject: [PATCH 7/7] Remove EL6 testing from Travis --- provision.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/provision.yaml b/provision.yaml index 048af121..cc86b647 100644 --- a/provision.yaml +++ b/provision.yaml @@ -22,9 +22,6 @@ travis_ub: images: - litmusimage/ubuntu:16.04 - litmusimage/ubuntu:18.04 -travis_el6: - provisioner: docker - images: [] travis_el7: provisioner: docker images: