Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modulesync 7.2.0 #82

Merged
merged 6 commits into from
Mar 23, 2024
Merged
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
11 changes: 7 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,21 @@ simple tests against it after applying the module. You can run this
with:

```sh
BEAKER_setfile=debian11-64 bundle exec rake beaker
BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker
```

You can replace the string `debian10` with any common operating system.
You can replace the string `debian11` with any common operating system.
The following strings are known to work:

* ubuntu1804
* ubuntu2004
* debian10
* ubuntu2204
* debian11
* centos7
* centos8
* centos9
* almalinux8
* almalinux9
* fedora36

For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests).

Expand Down
3 changes: 0 additions & 3 deletions .github/SECURITY.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
release:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v1
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v2
with:
allowed_owner: 'voxpupuli'
secrets:
Expand Down
41 changes: 0 additions & 41 deletions .gitlab-ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '5.5.0'
modulesync_config_version: '7.2.0'
24 changes: 0 additions & 24 deletions .pdkignore

This file was deleted.

1 change: 1 addition & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
/.yardoc/
/.yardopts
/Dockerfile
/HISTORY.md
10 changes: 4 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 5.4', :require => false
gem 'voxpupuli-test', '~> 7.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 2.0', :require => false
gem 'webrick', :require => false if RUBY_VERSION >= '3.2'
gem 'puppet_metadata', '~> 3.5', :require => false
end

group :development do
Expand All @@ -17,13 +17,11 @@ group :development do
end

group :system_tests do
gem 'voxpupuli-acceptance', '~> 1.0', :require => false
gem 'voxpupuli-acceptance', '~> 3.0', :require => false
end

group :release do
gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5'
gem 'voxpupuli-release', '~> 2.0', :require => false
gem 'faraday-retry', '~> 2.1', :require => false if RUBY_VERSION >= '2.6'
gem 'voxpupuli-release', '~> 3.0', :require => false
end

gem 'rake', :require => false
Expand Down
52 changes: 0 additions & 52 deletions appveyor.yml

This file was deleted.

14 changes: 7 additions & 7 deletions lib/puppet_x/vault_lookup/lookup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def self.lookup(cache:,

if vault_addr.nil?
Puppet.debug 'No Vault address was set on function, defaulting to value from VAULT_ADDR env value'
vault_addr = ENV['VAULT_ADDR']
vault_addr = ENV.fetch('VAULT_ADDR', nil)
raise Puppet::Error, 'No vault_addr given and VAULT_ADDR env variable not set' if vault_addr.nil?
end

if namespace.nil?
Puppet.debug 'No Vault namespace was set on function, defaulting to value from VAULT_NAMESPACE env value'
namespace = ENV['VAULT_NAMESPACE']
namespace = ENV.fetch('VAULT_NAMESPACE', nil)
end

# Check the cache.
Expand All @@ -41,9 +41,9 @@ def self.lookup(cache:,
return prior_result
end

auth_method = ENV['VAULT_AUTH_METHOD'] || 'cert' if auth_method.nil?
role_id = ENV['VAULT_ROLE_ID'] if role_id.nil?
secret_id = ENV['VAULT_SECRET_ID'] if secret_id.nil?
auth_method = ENV.fetch('VAULT_AUTH_METHOD', 'cert') if auth_method.nil?
role_id = ENV.fetch('VAULT_ROLE_ID', nil) if role_id.nil?
secret_id = ENV.fetch('VAULT_SECRET_ID', nil) if secret_id.nil?
cert_path_segment = 'v1/auth/cert/' if cert_path_segment.nil?
approle_path_segment = 'v1/auth/approle/' if approle_path_segment.nil?

Expand Down Expand Up @@ -85,8 +85,8 @@ def self.lookup(cache:,
# This assumes the token is availble in a sink file populated by the Vault Agent.
# @see https://developer.hashicorp.com/vault/docs/agent/autoauth/sinks/file
if agent_sink_file.nil?
Puppet.debug "No agent sink file was set on function, defaulting to VAULT_AGENT_SINK_FILE env var: #{ENV['VAULT_AGENT_SINK_FILE']}"
agent_sink_file = ENV['VAULT_AGENT_SINK_FILE']
Puppet.debug "No agent sink file was set on function, defaulting to VAULT_AGENT_SINK_FILE env var: #{ENV.fetch('VAULT_AGENT_SINK_FILE', nil)}"
agent_sink_file = ENV.fetch('VAULT_AGENT_SINK_FILE', nil)
end
raise Puppet::Error, 'agent_sink_file must be defined when using the agent_sink auth method' if agent_sink_file.nil?

Expand Down
6 changes: 2 additions & 4 deletions spec/acceptance/lookup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

require 'beaker-rspec'
require 'beaker-rspec/spec_helper'
require 'beaker-puppet'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'
require 'beaker_puppet_helpers'

describe 'lookup with vault configured to accept certs from puppetserver' do
before(:all) do
# Since beaker has not run the PrebuiltSteps to add /opt/puppetlabs/* to the
# PATH, add the directories to the top of the /etc/bash.bashrc so the dirs
# are available for all non-interactive bash shells.
on(master, "sed -i '1s_^_PATH=/opt/puppetlabs/server/bin:/opt/puppetlabs/puppet/bin:/opt/puppetlabs/bin:$PATH\\n_' /etc/bash.bashrc")
install_module_on(master)
install_local_module_on(master)
vault = find_host_with_role('vault')
scp_to(vault, 'spec/acceptance/fixtures/unseal.sh', '/root/unseal.sh')
on(vault, 'su root /root/unseal.sh')
Expand Down
2 changes: 1 addition & 1 deletion spec/mock_vault_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module PuppetVaultLookupHelpers
"lease_duration": 0,
"data": null,
"wrap_info": null,
"warnings": ["Invalid path for a versioned K/V secrets engine. See the API docs for the appropriate API endpoints to use. If using the Vault CLI, use \'vault kv get\' for this operation."],
"warnings": ["Invalid path for a versioned K/V secrets engine. See the API docs for the appropriate API endpoints to use. If using the Vault CLI, use 'vault kv get' for this operation."],
"auth": null
}
JSON
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
add_custom_fact name.to_sym, value
end
end
Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f }
Loading