On 09-12-10 09:44, Hubert Krause wrote:
> Hello,
> 
> Am Wednesday 08 December 2010 22:22:10 schrieb Patrick:
>> What distro are you using?
> 
> CentOS and Debian. New server will always be Debian. Our Puppet Server is 
> CentOS at the moment.
> 
>> Why not just install Augeas when you install puppet?  That's usually much
>> easier.
> 
> Yes, but I want something Idiot proof (I am the idiot in case of doubt). At 
> the moment we install our server by hand. In future we want to use some sort 
> of automatic install, but not at the moment.
> 
> We get errormessages verry instantly If we forget to install augeas, so we 
> have not that big pressure to implement automatic augeas detection. But it 
> would be nice.

An example: add the following to

<puppet_path>/modules/<modulename>/lib/facter/augeas_available.rb

-- cut here --
require 'facter'

Facter.add("augeas_available") do

    setcode do

        avail = "no"
        Dir.glob("/usr/lib/libaugeas*") { |filename|
                  avail = "yes"
        }
        avail
    end
end
-- cut here --

It simple looks for files named /usr/lib/libaugeas*. I am not sure if that
is appropriate for CentOS too, but it works on Debian. Of course, this is
no guarantee that the Ruby-bindings are also available, so this is still
not idiot-proof.

After installing the fact, you can do something like this in a manifest:

if $augeas_availabe {

    augeas { "foo":
    }

}

Best regards,
Martijn.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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