Skip to content

Commit

Permalink
Updates - Including drop Debian 9 support
Browse files Browse the repository at this point in the history
PDK update
Lots of lint fixes
  • Loading branch information
treydock committed Mar 17, 2023
1 parent 9cc89e7 commit 411c9f0
Show file tree
Hide file tree
Showing 56 changed files with 250 additions and 215 deletions.
23 changes: 15 additions & 8 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
fixtures:
repositories:
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
epel: https://github.com/voxpupuli/puppet-epel.git
apt: https://github.com/puppetlabs/puppetlabs-apt.git
inifile: https://github.com/puppetlabs/puppetlabs-inifile.git
firewall: https://github.com/puppetlabs/puppetlabs-firewall.git
yumrepo_core: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
python: https://github.com/voxpupuli/puppet-python.git
forge_modules:
stdlib:
repo: puppetlabs/stdlib
epel:
repo: puppet/epel
apt:
repo: puppetlabs/apt
inifile:
repo: puppetlabs/inifile
firewall:
repo: puppetlabs/firewall
yumrepo_core:
repo: puppetlabs/yumrepo_core
python:
repo: puppet/python
symlinks:
globus: "#{source_dir}"
19 changes: 7 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- master
pull_request:


jobs:
unit:
runs-on: ubuntu-latest
Expand All @@ -15,11 +16,11 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: 2.5.7
- ruby: 2.5.9
puppet: 6
fixtures: .fixtures.yml
allow_failure: false
- ruby: 2.7.0
- ruby: 2.7.6
puppet: 7
fixtures: .fixtures.yml
allow_failure: false
Expand All @@ -36,6 +37,7 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cache-version: 2
bundler: '2.1.0'
- name: Validate
run: bundle exec rake check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint
Expand All @@ -47,9 +49,8 @@ jobs:
fail-fast: false
matrix:
set:
- "centos-7"
- "rocky-8"
- "debian-9"
- "el7"
- "el8"
- "debian-10"
- "ubuntu-1804"
- "ubuntu-2004"
Expand All @@ -65,19 +66,13 @@ jobs:
run: |
echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
# https://github.com/actions/virtual-environments/issues/181#issuecomment-610874237
- name: apparmor
run: |
set -x
sudo apt-get remove mysql-server --purge
sudo apt-get install apparmor-profiles
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
cache-version: 2
bundler: '2.1.0'
- name: Run tests
run: bundle exec rake beaker
Expand Down
39 changes: 14 additions & 25 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
require:
- rubocop-rspec
- rubocop-i18n
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
TargetRubyVersion: '2.5'
Include:
- "./**/*.rb"
- "**/*.rb"
Exclude:
- bin/*
- ".vendor/**/*"
Expand All @@ -21,13 +20,6 @@ AllCops:
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/**/*
Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand All @@ -40,10 +32,6 @@ Style/BlockDelimiters:
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
be consistent then.
EnforcedStyle: braces_for_chaining
Style/BracesAroundHashParameters:
Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0.
See https://github.com/rubocop-hq/rubocop/pull/7643
Enabled: true
Style/ClassAndModuleChildren:
Description: Compact style reduces the required amount of indentation.
EnforcedStyle: compact
Expand Down Expand Up @@ -72,13 +60,20 @@ Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/TrailingCommaInLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
RSpec/ImplicitSubject:
Enabled: false
Lint/BooleanSymbol:
Enabled: false
Naming/MethodParameterName:
AllowedNames:
- is
RSpec/RepeatedExampleGroupBody:
Enabled: false
RSpec/RepeatedDescription:
Enabled: false
RSpec/MessageSpies:
EnforcedStyle: receive
Style/Documentation:
Expand All @@ -93,15 +88,9 @@ Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
GetText/DecorateFunctionMessage:
Enabled: false
GetText/DecorateStringFormattingUsingInterpolation:
Enabled: false
GetText/DecorateStringFormattingUsingPercent:
Enabled: false
Layout/EndOfLine:
Enabled: false
Layout/IndentHeredoc:
Layout/HeredocIndentation:
Enabled: false
Metrics/AbcSize:
Enabled: false
Expand Down
20 changes: 17 additions & 3 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@
.github/workflows/ci.yaml:
acceptance_matrix:
set:
- centos-7
- rocky-8
- debian-9
- el7
- el8
- ---el9
- debian-10
- ubuntu-1804
- ubuntu-2004
puppet:
- puppet6
- puppet7
.rubocop.yml:
profiles:
strict:
configs:
RSpec/RepeatedExampleGroupBody:
Enabled: false
RSpec/RepeatedDescription:
Enabled: false
.gitlab-ci.yml:
delete: true
appveyor.yml:
delete: true
spec/acceptance/nodesets/el9.yml:
delete: true
spec/acceptance/nodesets/debian-11.yml:
delete: true
spec/acceptance/nodesets/ubuntu-2204.yml:
delete: true
spec/acceptance/nodesets/centos-7.yml:
extra_commands:
- 'echo "LC_ALL=en_US.UTF-8" >> /etc/environment'
Expand Down
26 changes: 9 additions & 17 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,22 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
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 "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]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-lint-param-docs", require: false
gem "github_changelog_generator", require: false
gem "voxpupuli-test", '5.4.1', require: false
gem "faraday", '~> 1.0', require: false
gem "github_changelog_generator", require: false
gem "puppet-blacksmith", require: false
gem "puppet-strings", require: false
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.0')
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.29')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
gem "beaker-docker", *location_for(ENV['BEAKER_DOCKER_VERSION'] || '~> 0.7.0')
gem "beaker-docker"
gem "beaker-puppet"
gem "beaker-puppet_install_helper", require: false
gem "beaker-module_install_helper", require: false
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'beaker-rspec/rake_task' if Bundler.rubygems.find_name('beaker-rspec').any?
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?
Expand Down
2 changes: 2 additions & 0 deletions lib/facter/globus_info.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'json'
require 'facter/util/globus'

Expand Down
2 changes: 2 additions & 0 deletions lib/facter/globus_node_setup.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'facter/util/globus'

Facter.add('globus_node_setup') do
Expand Down
4 changes: 4 additions & 0 deletions lib/facter/util/globus.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Util class for Globus facts
class Facter::Util::Globus
def self.info
Expand All @@ -10,8 +12,10 @@ def self.info_exists?

def self.read_info
return nil unless info_exists?

f = File.read(info)
return nil if f.nil?

value = nil
begin
value = JSON.parse(f)
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/functions/globus/endpoint_setup_args.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Puppet::Functions.create_function(:'globus::endpoint_setup_args') do
dispatch :args do
param 'Hash', :values
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/functions/globus/node_setup_args.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Puppet::Functions.create_function(:'globus::node_setup_args') do
dispatch :args do
param 'Hash', :values
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/provider/globus_connect_config/ini_setting.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Puppet::Type.type(:globus_connect_config).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:ruby),
Expand Down
10 changes: 5 additions & 5 deletions lib/puppet/type/globus_connect_config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Puppet::Type.newtype(:globus_connect_config) do
ensurable

Expand Down Expand Up @@ -47,16 +49,14 @@ def should_to_s(newvalue)
end

validate do
if self[:ensure] == :present
if self[:value].nil?
raise Puppet::Error, "Property value must be set for #{self[:name]} when ensure is present"
end
if self[:ensure] == :present && self[:value].nil?
raise Puppet::Error, "Property value must be set for #{self[:name]} when ensure is present"
end
end

autorequire(:file) do
[
'/etc/globus-connect-server.conf',
'/etc/globus-connect-server.conf'
]
end
end
1 change: 0 additions & 1 deletion manifests/cli.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
Stdlib::Absolutepath $install_path = '/opt/globus-cli',
Boolean $manage_python = true,
) {

if $manage_python {
include globus::python
}
Expand Down
Loading

0 comments on commit 411c9f0

Please sign in to comment.