[Puppet Users] Re: Facter value at Catalog compilation

2013-09-23 Thread jcbollinger
On Thursday, September 19, 2013 4:23:15 PM UTC-5, Frederiko Costa wrote: > > Hi, > > I've got a facter shipped with a custom module. This factor returns the > version of a determined package. It returns nil if the package is not > installed yet. > > When running for the first time, assuming the

[Puppet Users] Re: Facter value at Catalog compilation

2013-09-20 Thread Ellison Marks
Post the code for the custom fact? On Thursday, September 19, 2013 2:23:15 PM UTC-7, Frederiko Costa wrote: > > Hi, > > I've got a facter shipped with a custom module. This factor returns the > version of a determined package. It returns nil if the package is not > installed yet. > > When runnin

Re: [Puppet Users] Re: Facter value at Catalog compilation

2013-09-20 Thread Frederiko Costa
Sure ... Here it is: # # terracota_version.rb # # Reports terracota version if terracotta is installed Facter.add(:terracotta_version) do cmd = %x{/bin/rpm -qa terracotta --queryformat %{VERSION}} setcode do if ! cmd.nil? cmd else nil end end end -frederiko On Fri, Sep 20, 2013 at 10: