Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <your-package-list-here>

23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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",
}
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
18 changes: 18 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
image:
file: .gitpod.Dockerfile

tasks:
- init: pdk bundle install

vscode:
extensions:
- puppet.puppet-vscode@1.0.0:oSzfTkDf6Cmc1jOjgW33VA==
2 changes: 2 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
Expand All @@ -40,3 +41,4 @@
/.yardopts
/spec/
/.vscode/
/.sync.yml
5 changes: 5 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use_litmus: true
litmus:
provision_list:
- ---travis_el
- travis_deb
- travis_ub
- travis_el7
Expand Down Expand Up @@ -58,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
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ jobs:
stage: acceptance
-
before_script:
- "bundle exec rake 'litmus:provision_list[travis_el7]'"
- "bundle exec rake 'litmus:provision_list[travis_ub]'"
- "bundle exec rake 'litmus:install_agent[puppet5]'"
- "bundle exec rake litmus:install_module"
bundler_args:
env: PLATFORMS=travis_el7_puppet5
env: PLATFORMS=travis_ub_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]'"
- "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_ub_puppet5
env: PLATFORMS=travis_el7_puppet5
rvm: 2.5.7
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
services: docker
Expand All @@ -73,22 +73,22 @@ jobs:
stage: acceptance
-
before_script:
- "bundle exec rake 'litmus:provision_list[travis_el7]'"
- "bundle exec rake 'litmus:provision_list[travis_ub]'"
- "bundle exec rake 'litmus:install_agent[puppet6]'"
- "bundle exec rake litmus:install_module"
bundler_args:
env: PLATFORMS=travis_el7_puppet6
env: PLATFORMS=travis_ub_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]'"
- "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_ub_puppet6
env: PLATFORMS=travis_el7_puppet6
rvm: 2.5.7
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
services: docker
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
stage: acceptance
branches:
only:
- master
- main
- /^v\d/
notifications:
email: false
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,35 @@ 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",
"labels" => ["backwards-incompatible"],
},
"Added" => {
"prefix" => "### Added",
"labels" => ["feature", "enhancement"],
"labels" => ["enhancement", "feature"],
},
"Fixed" => {
"prefix" => "### Fixed",
"labels" => ["bugfix"],
"labels" => ["bug", "documentation", "bugfix"],
},
}
end
else
desc 'Generate a Changelog from GitHub'
task :changelog do
raise <<EOM
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
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'
git: 'https://github.com/skywinder/github-changelog-generator'
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= 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
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: 1.1.x.{build}
branches:
only:
- master
- main
- release
skip_commits:
message: /^\(?doc\)?.*/
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--- {}
21 changes: 21 additions & 0 deletions hiera.yaml
Original file line number Diff line number Diff line change
@@ -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'
6 changes: 3 additions & 3 deletions lib/puppet/provider/exec/powershell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/provider/exec/pwsh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"version_requirement": ">= 5.5.0 < 7.0.0"
}
],
"pdk-version": "1.18.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#master",
"template-ref": "heads/master-0-g9c14433"
"pdk-version": "1.18.1",
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
"template-ref": "heads/main-0-g874030e"
}
Loading