Skip to content

Commit

Permalink
Avoid warn with puppet4
Browse files Browse the repository at this point in the history
"gnupg_installed" fact is not present by default, and we got this message in puppet4 server log :
WARN  [puppetserver] Puppet Unknown variable: '::gnupg_installed'. at 

An idea is to use the $facts['fact_name'] :
https://docs.puppet.com/puppet/4.10/lang_facts_and_builtin_vars.html#the-factsfactname-hash
  • Loading branch information
PascalBourdier authored Jun 7, 2017
1 parent b0a5a0c commit 70f8bf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$key_server = 'hkp://keys.gnupg.net'

# install the gpg key if gpg is installed or being installed in this puppet run
if defined(Class['::gnupg']) or $::gnupg_installed {
if defined(Class['::gnupg']) or $facts['gnupg_installed'] {
$gnupg_key_id = 'D39DC0E3'
} else {
$gnupg_key_id = false
Expand Down

0 comments on commit 70f8bf4

Please sign in to comment.