Re: [Puppet Users] Conditional with variable from facter

2012-06-20 Thread david.gar...@gmail.com
I also use some other stuff in my nagios.pp to get puppet facts into mcollective. file { "/usr/lib/nagios/.mcollective/etc/facts.yaml": mode=> "0644", owner => "104", group => "106", loglevel => debug, content => inline_template("<%= scope.to_hash.reject { |k,v| k.to

Re: [Puppet Users] Conditional with variable from facter

2012-06-20 Thread david.gar...@gmail.com
With in the class I used something like this to get the facts into my nagios templates: define host($ip = $::fqdn, $short_alias = $::fqdn, $hostgroup = $::product_info, $product_domain = $::product_domain) { case $product_info { /OneProduct/: { $nagios_cfgdir = "/usr/local/nagios/

Re: [Puppet Users] Conditional with variable from facter

2012-06-20 Thread Jeff McCune
On Wed, Jun 20, 2012 at 1:22 PM, Jakov Sosic wrote: > > I'm puzzled as to why can't I just use $operatingsystemrelease, and what > > do these two semicolons mean? > > > Any ideas?! :) Anyone?!?! http://docs.puppetlabs.com/guides/scope_and_puppet.html -Jeff -- You received this message becaus

Re: [Puppet Users] Conditional with variable from facter

2012-06-20 Thread Ashley Penney
The :: refer to scope, in this case it's saying "variables at the very top scope of what puppet knows about". This is because you can have: $::operatingsystem $module::class::operatingsystem And it's not sure which one you mean. By adding the :: you're making sure it knows to check the fact and

Re: [Puppet Users] Conditional with variable from facter

2012-06-20 Thread Jakov Sosic
On 06/18/2012 03:25 PM, Jakov Sosic wrote: > Hi. > > I have the following facts available: > > # facter | grep oper > operatingsystem => CentOS > operatingsystemrelease => 6.2 > > Now, if I wish to use conditionals on these facts, I have to do it like > this: > > case $operatingsystem {} > case

Re: [Puppet Users] Conditional with variable from facter

2012-06-18 Thread Wolf Noble
D'oh On Jun 18, 2012, at 11:26 AM, Martin Alfke wrote: > Hi, > > On 18.06.2012, at 17:14, Wolf Noble wrote: > >> Hi Jakov, >> >> the two semicolons locate these variables as being in top-scope/variables >> outside of any specific module. > > please note that these are colons (:) no semicolons(

Re: [Puppet Users] Conditional with variable from facter

2012-06-18 Thread Martin Alfke
Hi, On 18.06.2012, at 17:14, Wolf Noble wrote: > Hi Jakov, > > the two semicolons locate these variables as being in top-scope/variables > outside of any specific module. please note that these are colons (:) no semicolons(;). > > otherwise it might be $modulename::variable > > Does that

Re: [Puppet Users] Conditional with variable from facter

2012-06-18 Thread Wolf Noble
Hi Jakov, the two semicolons locate these variables as being in top-scope/variables outside of any specific module. otherwise it might be $modulename::variable Does that help at all? W On Jun 18, 2012, at 8:25 AM, Jakov Sosic wrote: > Hi. > > I have the following facts available: > > # fact

[Puppet Users] Conditional with variable from facter

2012-06-18 Thread Jakov Sosic
Hi. I have the following facts available: # facter | grep oper operatingsystem => CentOS operatingsystemrelease => 6.2 Now, if I wish to use conditionals on these facts, I have to do it like this: case $operatingsystem {} case $::operatingsystemrelease {} I'm puzzled as to why can't I just us