albatrossflavour / puppet_os_patching

A Puppet module that provides a set of tasks and custom facts which allows the automation of and reporting on OS patching
Apache License 2.0
44 stars 40 forks source link

facter -p no longer supported with Puppet 7 #190

Closed maxadamo closed 3 years ago

maxadamo commented 3 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

just use puppet 7 and the cron, will send an email to root with the warning below.

What are you seeing

[2021-01-19 12:21:08.897275 ] WARN Facter::Cli - facter --puppet and facter -p are no longer supported, use puppet facts show instead [2021-01-19 12:21:08.897321 ] WARN Facter::Cli - the output does not contain puppet facts!

Any additional information you'd like to impart

I wonder if puppet facts show is backward compatible, or you may need to run something as following:

if [ $(puppet --version|cut -d. -f1) -gt 5 ]; then
    ....
fi

with the problem being, puppet facts throws a json or yaml objest instead of the value

albatrossflavour commented 3 years ago

Ooops, looks like the tasks aren't working due to changes to the output of puppet facts. Reopening while I look into it.

albatrossflavour commented 3 years ago

Moved all of the facter stuff over to use the native ruby facter integration. Just testing that now but it looks good on Puppet 7.

albatrossflavour commented 3 years ago

Testing complete, merging.