Ask Your Question

What the valid way to set a varable = facter lookups

asked 2016-12-13 13:18:33 -0600

jrbast gravatar image

updated 2016-12-14 07:14:49 -0600

Is this correct?

class sudo_linux {
  $major = $os['release']['major']
  package { 'sudo':
    ensure  => "1.8.15-el${major}",
edit retag flag offensive close merge delete


This still does not work... I did a add, commit and push, but cannot see in list of classes to assign to hosts on puppet gui. Is there an error log to look at or a way to validate class sudo_linux { $major = $os['release']['major'] package { 'sudo': ensure => "1.8.15-el${major}", } }

jrbast gravatar imagejrbast ( 2016-12-14 07:14:14 -0600 )edit

Do a `notify { "${os}": }` to see what value `$os` has on a`puppet agent -tv` run. Note: Modern facts (like `$os` is) require a current version of facter (facter v3.x).

Kai Burghardt gravatar imageKai Burghardt ( 2016-12-14 07:53:05 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-12-13 15:29:28 -0600

lupin gravatar image

Are you using version 4.x? If you don't need the ::

edit flag offensive delete link more


I removed the ::, but still don't see the class show up in my list of classes on puppet console? is there a log file I can look at to see what's happening after a git push? Yes I did a refresh

jrbast gravatar imagejrbast ( 2016-12-13 15:38:54 -0600 )edit

Do you need to get it out of the facts hash?

DarylW gravatar imageDarylW ( 2016-12-14 07:43:07 -0600 )edit

Yes, facter os.release.major

jrbast gravatar imagejrbast ( 2016-12-14 08:22:19 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2016-12-13 13:18:33 -0600

Seen: 38 times

Last updated: Dec 14 '16