From 54a728cc7eb7110e61b2936e4ef7d496390eb338 Mon Sep 17 00:00:00 2001 From: Matthias Hensler Date: Tue, 21 Feb 2023 08:22:04 +0100 Subject: [PATCH] Update PDK --- .devcontainer/README.md | 8 ++++++-- .rubocop.yml | 2 +- Gemfile | 34 ++++++++++++++++++++++------------ manifests/home_server_pool.pp | 1 - manifests/init.pp | 2 -- manifests/ldap.pp | 2 +- manifests/module/detail.pp | 3 +-- manifests/module/eap.pp | 3 +-- manifests/module/files.pp | 6 +++--- manifests/module/huntgroup.pp | 2 +- manifests/module/ippool.pp | 4 ++-- manifests/module/perl.pp | 2 +- manifests/module/preprocess.pp | 2 +- manifests/params.pp | 1 - manifests/radsniff.pp | 2 +- manifests/sql.pp | 2 -- metadata.json | 6 +++--- 17 files changed, 44 insertions(+), 38 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index cc4675e5..a7193616 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -13,14 +13,18 @@ https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/pupp // Set *default* container specific settings.json values on container create. "settings": { - "terminal.integrated.shell.linux": "/bin/bash" + "terminal.integrated.profiles.linux": { + "bash": { + "path": "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": [], diff --git a/.rubocop.yml b/.rubocop.yml index 8f782e74..31e8248f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ require: - rubocop-rspec AllCops: DisplayCopNames: true - TargetRubyVersion: '2.4' + TargetRubyVersion: '2.5' Include: - "**/*.rb" Exclude: diff --git a/Gemfile b/Gemfile index a167b889..4ffa7860 100644 --- a/Gemfile +++ b/Gemfile @@ -13,21 +13,31 @@ def location_for(place_or_version, fake_version = nil) end end -ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments -minor_version = ruby_version_segments[0..1].join('.') - group :development do - 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 "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] - gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] - gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] + 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', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "voxpupuli-puppet-lint-plugins", '~> 3.1', require: false + gem "facterdb", '~> 1.18', require: false + gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false + gem "puppetlabs_spec_helper", '>= 3.0.0', '< 5.0.0', require: false + gem "rspec-puppet-facts", '~> 2.0', require: false + gem "codecov", '~> 0.2', require: false + gem "dependency_checker", '~> 0.2', require: false + gem "parallel_tests", '~> 3.4', require: false + gem "pry", '~> 0.10', require: false + gem "simplecov-console", '~> 0.5', require: false + gem "puppet-debugger", '~> 1.0', require: false + gem "rubocop", '= 1.6.1', require: false + gem "rubocop-performance", '= 1.9.1', require: false + gem "rubocop-rspec", '= 2.0.1', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] end group :system_tests do - gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] - gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby] + gem "serverspec", '~> 2.41', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/manifests/home_server_pool.pp b/manifests/home_server_pool.pp index 8714c33a..bb3ae7d0 100644 --- a/manifests/home_server_pool.pp +++ b/manifests/home_server_pool.pp @@ -14,4 +14,3 @@ order => 20, } } - diff --git a/manifests/init.pp b/manifests/init.pp index 3654e2dd..0e1c922a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -23,7 +23,6 @@ Optional[String] $package_ensure = 'installed', String $radacctdir = $freeradius::params::radacctdir, ) inherits freeradius::params { - if $freeradius::fr_version !~ /^3/ { notify { 'This module is only compatible with FreeRADIUS 3.': } } @@ -185,7 +184,6 @@ order => '95', } - # Set up concat proxy file concat { "${freeradius::fr_basepath}/proxy.conf": owner => 'root', diff --git a/manifests/ldap.pp b/manifests/ldap.pp index 58419027..53a8681a 100644 --- a/manifests/ldap.pp +++ b/manifests/ldap.pp @@ -23,7 +23,7 @@ ) { warning('The use of freeradius::ldap is deprecated. You must use freeradius::module::ldap instead') - freeradius::module::ldap {$name: + freeradius::module::ldap { $name: ensure => $ensure, identity => $identity, password => $password, diff --git a/manifests/module/detail.pp b/manifests/module/detail.pp index 6c8cefb3..0dbecf45 100644 --- a/manifests/module/detail.pp +++ b/manifests/module/detail.pp @@ -1,4 +1,3 @@ - # == Define: freeradius::module::detail # define freeradius::module::detail ( @@ -16,7 +15,7 @@ validate_array($suppress) } - freeradius::module {"detail.${name}": + freeradius::module { "detail.${name}": ensure => $ensure, content => template('freeradius/detail.erb'), } diff --git a/manifests/module/eap.pp b/manifests/module/eap.pp index 1287da90..71e435f9 100644 --- a/manifests/module/eap.pp +++ b/manifests/module/eap.pp @@ -75,8 +75,7 @@ Boolean $eap_gtc = true, Boolean $eap_peap = true, ) { - - freeradius::module{$name: + freeradius::module { $name: ensure => $ensure, content => template('freeradius/eap.erb'), } diff --git a/manifests/module/files.pp b/manifests/module/files.pp index abb4553f..9589761d 100644 --- a/manifests/module/files.pp +++ b/manifests/module/files.pp @@ -39,12 +39,12 @@ $usersdir = dirname($filename) } - freeradius::module {$name: + freeradius::module { $name: ensure => $ensure, content => template('freeradius/files.erb'), } - file {$usersdir: + file { $usersdir: ensure => $manage_dir, owner => 'root', group => $fr_group, @@ -52,7 +52,7 @@ require => Freeradius::Module[$name], } - file {$userspath: + file { $userspath: ensure => $ensure, owner => 'root', group => $fr_group, diff --git a/manifests/module/huntgroup.pp b/manifests/module/huntgroup.pp index 77ef5f44..3eaf4b9f 100644 --- a/manifests/module/huntgroup.pp +++ b/manifests/module/huntgroup.pp @@ -7,7 +7,7 @@ ) { warning('Use of freeradius::module::huntgroup is deprecated. Use freeradius::huntgroup instead') - freeradius::huntgroup {$name: + freeradius::huntgroup { $name: conditions => $conditions, order => $order, } diff --git a/manifests/module/ippool.pp b/manifests/module/ippool.pp index 79680b43..a11c0286 100644 --- a/manifests/module/ippool.pp +++ b/manifests/module/ippool.pp @@ -33,13 +33,13 @@ true => $ip_index, default => regsubst($ip_index, /\${db_dir}/, $freeradius::params::fr_basepath), } - file {$_file_path: + file { $_file_path: ensure => 'present', owner => $freeradius::params::fr_user, group => $freeradius::params::fr_group, mode => '0640', } - file {$_index_path: + file { $_index_path: ensure => 'present', owner => $freeradius::params::fr_user, group => $freeradius::params::fr_group, diff --git a/manifests/module/perl.pp b/manifests/module/perl.pp index d870b2b7..dd8e31b4 100644 --- a/manifests/module/perl.pp +++ b/manifests/module/perl.pp @@ -14,7 +14,7 @@ $fr_group = $::freeradius::params::fr_group $fr_service = $::freeradius::params::fr_service $source = "${path}/${perl_filename}" - freeradius::module {'perl': + freeradius::module { 'perl': ensure => $ensure, content => template('freeradius/perl.erb'), } diff --git a/manifests/module/preprocess.pp b/manifests/module/preprocess.pp index 5c8d451a..b0704a1a 100644 --- a/manifests/module/preprocess.pp +++ b/manifests/module/preprocess.pp @@ -15,7 +15,7 @@ $fr_group = $::freeradius::params::fr_group $fr_service = $::freeradius::params::fr_service - freeradius::module {'preprocess': + freeradius::module { 'preprocess': ensure => $ensure, content => template('freeradius/preprocess.erb'), } diff --git a/manifests/params.pp b/manifests/params.pp index 14cea905..78c4292f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,6 +1,5 @@ # Default parameters for freeradius class freeradius::params { - # Make an educated guess which version of FR we are running, based on the OS case $::operatingsystem { /RedHat|CentOS|Rocky/: { diff --git a/manifests/radsniff.pp b/manifests/radsniff.pp index 52c1c3b1..094629be 100644 --- a/manifests/radsniff.pp +++ b/manifests/radsniff.pp @@ -50,7 +50,7 @@ enable => true, } - systemd::unit_file {'radsniff.service': + systemd::unit_file { 'radsniff.service': content => template('freeradius/radsniff.service.erb'), notify => Service['radsniff'], } diff --git a/manifests/sql.pp b/manifests/sql.pp index cb8ac409..72c528b8 100644 --- a/manifests/sql.pp +++ b/manifests/sql.pp @@ -73,7 +73,6 @@ undef => 3.0, default => $pool_connect_timeout, } - } else { if $pool_connect_timeout != undef { fail(@("FAIL"/L) @@ -85,7 +84,6 @@ } } - # Determine default location of query file $queryfile = "${fr_basepath}/sql/queries.conf" diff --git a/metadata.json b/metadata.json index 32f267e9..22d2b42a 100644 --- a/metadata.json +++ b/metadata.json @@ -85,7 +85,7 @@ "version_requirement": ">=4.0.0 <7.0.0" } ], - "pdk-version": "2.4.0", - "template-url": "pdk-default#2.4.0", - "template-ref": "tags/2.4.0-0-gfa6b6d2" + "pdk-version": "2.6.1", + "template-url": "pdk-default#2.7.1", + "template-ref": "tags/2.7.1-0-g9a16c87" }