Skip to content
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
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"name": "VoxBox",
"image": "ghcr.io/voxpupuli/voxbox:latest"
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/create_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

name: Create Git tag

on:
workflow_dispatch:

permissions: {}

jobs:
create_tag:
uses: 'voxpupuli/gha-puppet/.github/workflows/create_tag.yml@v4'
with:
allowed_owner: 'voxpupuli'
git_name: 'pccibot'
git_email: '12855858+pccibot@users.noreply.github.com'
secrets:
# Configure secrets here:
# https://docs.github.com/en/actions/security-guides/encrypted-secrets
ssh_private_key: ${{ secrets.PCCI_SSH_PRIVATE_KEY }}
5 changes: 4 additions & 1 deletion .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ permissions:

jobs:
release_prep:
uses: 'voxpupuli/gha-puppet/.github/workflows/prepare_release.yml@v3'
uses: 'voxpupuli/gha-puppet/.github/workflows/prepare_release.yml@v4'
with:
version: ${{ github.event.inputs.version }}
allowed_owner: 'voxpupuli'
git_name: 'pccibot'
git_email: '12855858+pccibot@users.noreply.github.com'
secrets:
# Configure secrets here:
# https://docs.github.com/en/actions/security-guides/encrypted-secrets
github_pat: '${{ secrets.PCCI_PAT_RELEASE_PREP }}'
ssh_private_key: '${{ secrets.PCCI_SSH_PRIVATE_KEY }}'
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ name: Release
on:
push:
tags:
- '*'
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onpushbranchestagsbranches-ignoretags-ignore
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#filter-pattern-cheat-sheet
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: write

jobs:
release:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v3
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v4
with:
allowed_owner: 'voxpupuli'
secrets:
Expand Down
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: '10.5.0'
modulesync_config_version: '10.7.0'
29 changes: 27 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-08-17 21:30:05 UTC using RuboCop version 1.50.2.
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
# using RuboCop version 1.85.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -33,6 +33,18 @@ RSpec/InstanceVariable:
- 'spec/unit/puppet/provider/sshd_config_subsystem/augeas_spec.rb'
- 'spec/unit/puppet/provider/sshkey/augeas_spec.rb'

# Offense count: 9
RSpec/LeakyLocalVariable:
Exclude:
- 'spec/unit/puppet/provider/ssh_config/augeas_spec.rb'
- 'spec/unit/puppet/provider/sshd_config/augeas_spec.rb'
- 'spec/unit/puppet/provider/sshd_config_match/augeas_spec.rb'
- 'spec/unit/puppet/provider/sshd_config_subsystem/augeas_spec.rb'
- 'spec/unit/puppet/provider/sshkey/augeas_spec.rb'
- 'spec/unit/puppet/type/ssh_config_spec.rb'
- 'spec/unit/puppet/type/sshd_config_match_spec.rb'
- 'spec/unit/puppet/type/sshd_config_spec.rb'

# Offense count: 3
RSpec/UnspecifiedException:
Exclude:
Expand All @@ -54,3 +66,16 @@ Style/AsciiComments:
- 'lib/puppet/type/sshd_config.rb'
- 'lib/puppet/type/sshd_config_match.rb'
- 'lib/puppet/type/sshd_config_subsystem.rb'

# Offense count: 1
# Configuration parameters: AllowedClasses.
Style/OneClassPerFile:
Exclude:
- 'lib/puppet/provider/sshkey/augeas.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
Style/ReturnNilInPredicateMethodDefinition:
Exclude:
- 'lib/puppet/provider/sshd_config_match/augeas.rb'
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 13.0', :require => false
gem 'voxpupuli-test', '~> 14.0', :require => false
gem 'puppet_metadata', '~> 6.0', :require => false
gem 'ruby-augeas', :require => false
end
Expand All @@ -19,7 +19,7 @@ group :system_tests do
end

group :release do
gem 'voxpupuli-release', '~> 5.0', :require => false
gem 'voxpupuli-release', '~> 5.3', :require => false
end

gem 'rake', :require => false
Expand Down
14 changes: 7 additions & 7 deletions lib/puppet/provider/sshd_config/augeas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ def self.instances
resources = []
# Ordinary settings outside of match blocks
# Find all unique setting names, then find all instances of it
settings = aug.match("$target/*[label()!='Match']").
map { |spath| path_label(aug, spath) }.
uniq.reject { |name| name.start_with?('#', '@') }
settings = aug.match("$target/*[label()!='Match']")
.map { |spath| path_label(aug, spath) }
.uniq.reject { |name| name.start_with?('#', '@') }

settings.each do |name|
next if name.casecmp('subsystem').zero?
Expand All @@ -139,16 +139,16 @@ def self.instances
end
cond_str = conditions.join(' ')

settings = aug.match("#{mpath}/Settings/*").
map { |spath| path_label(aug, spath) }.
uniq.reject { |name| name.start_with?('#', '@') }
settings = aug.match("#{mpath}/Settings/*")
.map { |spath| path_label(aug, spath) }
.uniq.reject { |name| name.start_with?('#', '@') }

settings.each do |name|
next if name.casecmp('subsystem').zero?

value = get_value(aug, "#{mpath}/Settings/#{name}")
entry = { ensure: :present, name: name,
value: value, condition: cond_str }
value: value, condition: cond_str, }
resources << new(entry) if entry[:value]
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/sshd_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def should_to_s(new_value)

super(is_arr | Array(new_value))
else
super(new_value)
super
end
end
end
Expand Down
48 changes: 24 additions & 24 deletions spec/unit/puppet/provider/ssh_config/augeas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
name: 'ForwardAgent',
value: 'yes',
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -32,7 +32,7 @@
name: 'GlobalKnownHostsFile',
value: ['/etc/ssh/ssh_known_hosts', '/etc/ssh/ssh_known_hosts2'],
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -46,7 +46,7 @@
name: 'SendEnv',
value: %w[LANG LC_TYPE],
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -61,7 +61,7 @@
host: 'example.net',
value: 'yes',
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -76,7 +76,7 @@
value: 'example_user',
target: target,
provider: 'augeas',
comment: 'Deny example_user access'
comment: 'Deny example_user access',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -92,15 +92,15 @@
name: 'ForwardAgent',
value: 'no',
target: target,
provider: 'augeas'
provider: 'augeas',
),
Puppet::Type.type(:ssh_config).new(
name: 'ForwardAgent',
host: 'example.net',
value: 'yes',
target: target,
provider: 'augeas'
)
provider: 'augeas',
),
)
end.to raise_error(Puppet::Resource::Catalog::DuplicateResourceError)
end
Expand All @@ -112,15 +112,15 @@
name: 'ForwardAgent',
value: 'no',
target: target,
provider: 'augeas'
provider: 'augeas',
),
Puppet::Type.type(:ssh_config).new(
name: 'Example ForwardAgent',
key: 'ForwardAgent',
value: 'yes',
target: target,
provider: 'augeas'
)
provider: 'augeas',
),
)
end.to raise_error
end
Expand All @@ -132,16 +132,16 @@
name: 'ForwardAgent',
value: 'no',
target: target,
provider: 'augeas'
provider: 'augeas',
),
Puppet::Type.type(:ssh_config).new(
name: 'Example ForwardAgent',
key: 'ForwardAgent',
host: 'example.net',
value: 'yes',
target: target,
provider: 'augeas'
)
provider: 'augeas',
),
)
end.not_to raise_error
end
Expand Down Expand Up @@ -180,7 +180,7 @@
host: 'example.net',
value: 'yes',
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -194,7 +194,7 @@
host: 'example.net',
value: ['LC_*', 'LANG'],
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -210,7 +210,7 @@
value: 'example_user',
target: target,
provider: 'augeas',
comment: 'Deny example_user access'
comment: 'Deny example_user access',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -226,7 +226,7 @@
ensure: 'absent',
host: '*',
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -240,7 +240,7 @@
ensure: 'absent',
host: '*',
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -256,7 +256,7 @@
host: '*',
value: 'no',
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -270,7 +270,7 @@
host: '*',
target: target,
provider: 'augeas',
comment: 'This is a different comment'
comment: 'This is a different comment',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -284,7 +284,7 @@
host: '*',
value: %w[foo bar],
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -299,7 +299,7 @@
name: 'GssaPiaUthentication',
value: 'yes',
target: target,
provider: 'augeas'
provider: 'augeas',
))

aug_open(target, 'Ssh.lns') do |aug|
Expand All @@ -319,7 +319,7 @@
name: 'ForwardAgent',
value: 'yes',
target: target,
provider: 'augeas'
provider: 'augeas',
))

expect(txn.any_failed?).not_to eq(nil)
Expand Down
Loading
Loading