From 7d368ae42fc798d38664d76db346624c2fa0566c Mon Sep 17 00:00:00 2001 From: tenajsystems Date: Wed, 9 Jun 2021 14:42:03 -0400 Subject: [PATCH 1/3] initial metadata.json update --- metadata.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/metadata.json b/metadata.json index 85540bf..6617569 100644 --- a/metadata.json +++ b/metadata.json @@ -1,9 +1,9 @@ { "name": "MiamiOH-duo_authproxy", - "version": "1.0.0", + "version": "1.1.0", "author": "Chris Edester", "summary": "Installs and configures Duo Authentication Proxy", - "license": "GPL-3.0+", + "license": "GPL-3.0", "source": "https://github.com/MiamiOH/puppet-duo_authproxy.git", "project_page": "https://github.com/MiamiOH/puppet-duo_authproxy", "issues_url": "https://github.com/MiamiOH/puppet-duo_authproxy/issues", @@ -56,14 +56,15 @@ "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "16.04", - "18.04" + "18.04", + "20.04" ] } ], "requirements": [ { "name": "puppet", - "version_requirement": ">= 4.7.0 < 6.0.0" + "version_requirement": ">= 4.7.0 < 8.0.0" } ], "tags": [ @@ -72,6 +73,6 @@ "ldap" ], "pdk-version": "1.18.0", - "template-url": "pdk-default#1.18.0", - "template-ref": "tags/1.18.0-0-g095317c" + "template-url": "https://github.com/puppetlabs/pdk-templates#master", + "template-ref": "remotes/origin/master-0-ga58fd92" } From 413d926e70ded294eee532c3278e7d29d49722d2 Mon Sep 17 00:00:00 2001 From: tenajsystems Date: Wed, 9 Jun 2021 14:48:57 -0400 Subject: [PATCH 2/3] added param for exec timeout and some minor updates --- .rubocop.yml | 2 +- .sync.yml | 2 ++ CHANGELOG.md | 9 +++++++++ Rakefile | 13 ++++++------- manifests/config.pp | 2 +- manifests/init.pp | 13 +++++++------ manifests/install.pp | 4 ++++ metadata.json | 2 +- spec/classes/config_spec.rb | 5 ++++- spec/spec_helper.rb | 4 ++++ 10 files changed, 39 insertions(+), 17 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 5307849..858882d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -43,7 +43,7 @@ Style/BlockDelimiters: 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 + Enabled: false Style/ClassAndModuleChildren: Description: Compact style reduces the required amount of indentation. EnforcedStyle: compact diff --git a/.sync.yml b/.sync.yml index 279030f..f4c290a 100644 --- a/.sync.yml +++ b/.sync.yml @@ -42,3 +42,5 @@ Rakefile: spec/default_facts.yml: extra_facts: operatingsystemrelease: 18.04 +spec/spec_helper.rb: + mock_with: ':rspec' diff --git a/CHANGELOG.md b/CHANGELOG.md index 37b9f37..233be2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## Release 1.1.0 +* Updated pdk version +* Added parameter for exec timeout(default is 300 seconds) +* Set correct owner for the `authproxy.cfg` file +* Fixed metadata license syntax +* Added Ubuntu 20.04 support +* Fixed pdk validation warnings +* Fixed deprecation warnings +## Release 1.0.0 * Added support for Ubuntu 18.04 * Replaced deprecated stankevich-python dependency a with puppet-python * Updated pdk version diff --git a/Rakefile b/Rakefile index a235b9d..cb0c0f8 100644 --- a/Rakefile +++ b/Rakefile @@ -53,7 +53,7 @@ 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", @@ -61,11 +61,11 @@ if Bundler.rubygems.find_name('github_changelog_generator').any? }, "Added" => { "prefix" => "### Added", - "labels" => ["feature", "enhancement"], + "labels" => ["enhancement", "feature"], }, "Fixed" => { "prefix" => "### Fixed", - "labels" => ["bugfix"], + "labels" => ["bug", "documentation", "bugfix"], }, } end @@ -73,16 +73,15 @@ else desc 'Generate a Changelog from GitHub' task :changelog do raise <= 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 diff --git a/manifests/config.pp b/manifests/config.pp index 7908dd8..01f4290 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -11,7 +11,7 @@ file { 'authproxy.cfg': ensure => file, path => "${duo_authproxy::install_dir}/conf/authproxy.cfg", - owner => 'nobody', + owner => 'duo_authproxy_svc', group => 'root', mode => '0400', content => Sensitive(template("${module_name}/authproxy.cfg.erb")), diff --git a/manifests/init.pp b/manifests/init.pp index 5950c94..4e972e1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,6 +13,7 @@ Hash $settings = {}, $proxy_server = undef, $proxy_type = undef, + $exec_timeout = 300, ) { if $::operatingsystemrelease == '18.04' { @@ -29,12 +30,12 @@ contain 'duo_authproxy::config' contain 'duo_authproxy::service' - Class['::duo_authproxy::install'] - -> Class['::duo_authproxy::config'] + Class['duo_authproxy::install'] + -> Class['duo_authproxy::config'] - Class['::duo_authproxy::install'] - ~> Class['::duo_authproxy::service'] + Class['duo_authproxy::install'] + ~> Class['duo_authproxy::service'] - Class['::duo_authproxy::config'] - ~> Class['::duo_authproxy::service'] + Class['duo_authproxy::config'] + ~> Class['duo_authproxy::service'] } diff --git a/manifests/install.pp b/manifests/install.pp index ee889f9..b01e48c 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -27,6 +27,7 @@ command => "mv duoauthproxy-${duo_authproxy::version}*-src duoauthproxy-${duo_authproxy::version}-src", cwd => '/tmp', path => '/bin', + timeout => $duo_authproxy::exec_timeout, creates => $creates_path, } @@ -35,6 +36,7 @@ cwd => "/tmp/duoauthproxy-${duo_authproxy::version}-src", environment => ['PYTHON=python'], path => $facts['path'], + timeout => $duo_authproxy::exec_timeout, creates => $creates_path, require => Package[$duo_authproxy::dep_packages], } @@ -44,12 +46,14 @@ cwd => "/tmp/duoauthproxy-${duo_authproxy::version}-src", environment => ['PYTHON=python'], path => $facts['path'], + timeout => $duo_authproxy::exec_timeout, creates => $creates_path, } -> exec { 'duoauthproxy-tag': command => "touch ${creates_path}", path => $facts['path'], + timeout => $duo_authproxy::exec_timeout, creates => $creates_path, } } diff --git a/metadata.json b/metadata.json index 6617569..32f32f1 100644 --- a/metadata.json +++ b/metadata.json @@ -72,7 +72,7 @@ "authentication", "ldap" ], - "pdk-version": "1.18.0", + "pdk-version": "2.1.0", "template-url": "https://github.com/puppetlabs/pdk-templates#master", "template-ref": "remotes/origin/master-0-ga58fd92" } diff --git a/spec/classes/config_spec.rb b/spec/classes/config_spec.rb index 5960143..9613a39 100644 --- a/spec/classes/config_spec.rb +++ b/spec/classes/config_spec.rb @@ -13,7 +13,10 @@ is_expected.to contain_file('authproxy.cfg').with( 'ensure' => 'file', 'path' => '/opt/duoauthproxy/conf/authproxy.cfg', - 'content' => "# Managed by Puppet.\n\n[main]\ndebug=true\n\n", + 'owner' => 'duo_authproxy_svc', + 'group' => 'root', + 'mode' => '0400', + 'content' => 'Sensitive [value redacted]', ) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d3778ca..b367fde 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,9 @@ # frozen_string_literal: true +RSpec.configure do |c| + c.mock_with :rspec +end + require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' From 36dc1b5c883041e5fd3e3012c380d435eb502d71 Mon Sep 17 00:00:00 2001 From: tenajsystems Date: Wed, 9 Jun 2021 15:10:51 -0400 Subject: [PATCH 3/3] added Ubuntu 20.04 operatingsystemrelease --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 4e972e1..5ed332f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,7 +16,7 @@ $exec_timeout = 300, ) { - if $::operatingsystemrelease == '18.04' { + if ($::operatingsystemrelease == '18.04') or ($::operatingsystemrelease == '20.04') { $python_version = 'python3_version' }else { $python_version = 'python_version'