Ask Your Question
0

What the valid way to set a varable = facter lookups

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

jrbast gravatar image

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

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

Comments

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 -0500 )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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

lupin gravatar image

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

edit flag offensive delete link more

Comments

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 -0500 )edit

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

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

Yes, facter os.release.major

jrbast gravatar imagejrbast ( 2016-12-14 08:22:19 -0500 )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

Stats

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

Seen: 37 times

Last updated: Dec 14 '16