Open sircubbi opened 2 months ago
I have some CI using this module with real certificats requested to LE staging CA. Now this CI does not run idempotently. So, i confirm that https://github.com/voxpupuli/puppet-letsencrypt/commit/9eddbb1d60ed9bc4938e8656ea8f32466b8eec25 introduce unexpected behavior.
Trace :
Info: Using environment 'production'
Info: Applying configuration version '1726063684'
Notice: /Stage[main]/Letsencrypt::Renew/Cron[letsencrypt-renew]/environment: defined 'environment' as
Notice: Applied catalog in 8.17 seconds
The core module puppetlabs-cron_core
have a provider that accept value absent
for property environment
https://github.com/puppetlabs/puppetlabs-cron_core/blob/main/lib/puppet/type/cron.rb#L325.
Perhaps a better default value is absent
, instead of empty array.
Edit : When environment
is empty (like with []
), the provider prefetch :absent
:
https://github.com/puppetlabs/puppetlabs-cron_core/blob/main/lib/puppet/provider/cron/crontab.rb#L224
So using empty array or absent is equal.
After some tests and pry usage, modifying puppetlabs-cron_core
it looks to be idempotent when environment => []
https://github.com/puppetlabs/puppetlabs-cron_core/pull/77
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
use
letsencrypt::renew
without any additional parametersWhat are you seeing
Notice: /Stage[main]/Letsencrypt::Renew/Cron[letsencrypt-renew]/environment: defined 'environment' as (corrective)
on every runWhat behaviour did you expect instead
Any additional information you'd like to impart
The change was introducted by #288. When looking at the discussion the new parameter was firstly defaulted to be
undef
, but later changed to an empty array (for removing any already existing environment). Unfortunately this produces an uncorrective change if no environment is used at all (could be that thecron
-ressource is the root-problem).I would really like to set the new parameter defaulting to
undef
and restore the previous behaviour.