From 837b5062fd07ed6a75e0b4c805f6ee6a2949585b Mon Sep 17 00:00:00 2001 From: markuszilch Date: Fri, 23 Feb 2024 18:54:05 +0100 Subject: [PATCH 1/2] simplify periodic_method check (no more old OSes); fix missing docs; regenerate reference --- REFERENCE.md | 90 ++++++++++++++++++++++++++++++++--------------- manifests/init.pp | 5 ++- 2 files changed, 63 insertions(+), 32 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 62019dc..b562674 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -8,7 +8,7 @@ #### Public Classes -* [`fetchcrl`](#fetchcrl) +* [`fetchcrl`](#fetchcrl): Main class, installs fetch-crl and configures it. #### Private Classes @@ -24,12 +24,47 @@ ### `fetchcrl` -The fetchcrl class. +fetchcrl + +* **See also** + * https://wiki.nikhef.nl/grid/FetchCRL3 + * FetchCRL3 + +#### Examples + +##### Simple Example + +```puppet +class{'fetchcrl': + http_proxy => 'http:://squid.example.org:8000', + carepo => 'http://yum.example.org/yumrepo', + cache_control_request => '3600', +} +``` + +##### A hash of particular CA configurations + +```puppet +class{'fetchcrl': + cas => { + 'EDG-Tutorial-CA' => { + 'agingtolerance' => 168, + } + 'MD-Grid-CA-T' => { + 'noerrors' => true, + } + } + } +} +``` #### Parameters The following parameters are available in the `fetchcrl` class: +* [`capkgs`](#-fetchcrl--capkgs) +* [`carepo`](#-fetchcrl--carepo) +* [`carepo_gpgkey`](#-fetchcrl--carepo_gpgkey) * [`manage_carepo`](#-fetchcrl--manage_carepo) * [`capkgs_version`](#-fetchcrl--capkgs_version) * [`pkg_version`](#-fetchcrl--pkg_version) @@ -48,9 +83,30 @@ The following parameters are available in the `fetchcrl` class: * [`randomcron`](#-fetchcrl--randomcron) * [`cache_control_request`](#-fetchcrl--cache_control_request) * [`cas`](#-fetchcrl--cas) -* [`capkgs`](#-fetchcrl--capkgs) -* [`carepo`](#-fetchcrl--carepo) -* [`carepo_gpgkey`](#-fetchcrl--carepo_gpgkey) + +##### `capkgs` + +Data type: `Array[String[1]]` + +CA policy packages to install. + +Default value: `['ca-policy-egi-core']` + +##### `carepo` + +Data type: `Stdlib::Httpurl` + +Repository URL of CA packages. + +Default value: `'https://repository.egi.eu/sw/production/cas/1/current/'` + +##### `carepo_gpgkey` + +Data type: `Stdlib::Httpurl` + +Repository URL of GPG key for CA packages. + +Default value: `'https://dist.eugridpma.info/distribution/igtf/current/GPG-KEY-EUGridPMA-RPM-3'` ##### `manage_carepo` @@ -200,30 +256,6 @@ A hash of `fetchcrl::ca` defined types to load. Default value: `undef` -##### `capkgs` - -Data type: `Array[String[1]]` - - - -Default value: `['ca-policy-egi-core']` - -##### `carepo` - -Data type: `Stdlib::Httpurl` - - - -Default value: `'https://repository.egi.eu/sw/production/cas/1/current/'` - -##### `carepo_gpgkey` - -Data type: `Stdlib::Httpurl` - - - -Default value: `'https://dist.eugridpma.info/distribution/igtf/current/GPG-KEY-EUGridPMA-RPM-3'` - ## Defined types ### `fetchcrl::ca` diff --git a/manifests/init.pp b/manifests/init.pp index 7bf501b..3c78f2c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -34,7 +34,7 @@ # # @param carepo_gpgkey # Repository URL of GPG key for CA packages. - +# # @param manage_carepo # Should package repository be configured. # @@ -117,8 +117,7 @@ Optional[Hash] $cas = undef, ) { # Is the package cron or systemd.timer based? - if ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'],'18.04') <= 0 ) or - ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'],'10') <= 0 ) or + if $facts['os']['family'] == 'Debian' or ($facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'7') <= 0 ) { $periodic_method = 'cron' } else { From 0c628d3534e818a090ff9782033bd099d06be23b Mon Sep 17 00:00:00 2001 From: markuszilch Date: Fri, 23 Feb 2024 23:43:01 +0100 Subject: [PATCH 2/2] fully remove check for debian family; was wrong way round --- manifests/init.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 3c78f2c..a1645d2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -117,8 +117,7 @@ Optional[Hash] $cas = undef, ) { # Is the package cron or systemd.timer based? - if $facts['os']['family'] == 'Debian' or - ($facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'7') <= 0 ) { + if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'7') <= 0 { $periodic_method = 'cron' } else { $periodic_method = 'timer'