Hi Nan:

On 10-05-2012 20:22, Nan Liu wrote:
On Thu, May 10, 2012 at 1:08 PM, mparrad<marco.parr...@gmail.com>  wrote:
Hi guys, I realized that If I make the file udp_status.rb and I put on
D:\Program Files (x86)\Puppet Labs\Puppet\facter\lib\facter, that's where I
installed puppet from the MSI file, and I use the Powershell script that I
made, I got the value that I expect when I run facter:

D:\>facter udp_status
true

Now, My question will be: How can I use thi fact on a resource exec, Is this
possible?, I tried using with onlyif =>  "$udp_status" but I got several
errors about convertions and another stuffs...
Facts are provided to the master, so in this case simply:

if $udp_status {
   exec { ... }
}

If the fact return false simply don't include the exec in the catalog.

HTH,

Nan


I tested as you said, I put the If statement previous to the resource exec using the udp_status fact , and It works perfect..


Thank you a lot...

Best Regards

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to