voxpupuli / puppet-augeas

Helper for using augeas with puppet
Apache License 2.0
43 stars 82 forks source link

Provide a way to not check the custom augeas #18

Closed nikolavp closed 11 years ago

nikolavp commented 11 years ago

Hi,

I am struggling with the fact that you are checking the custom augeas in your module. This is giving me problem as I am not sure why but puppet want to execute this command before applying the augeas class.

I tried many things like

Class['augeas'] -> Class['current-class-with-custom-augeas']

Class['augeas'] -> Augeas::Lens <| |>

putting a require Class['augeas'] but they didn't work. I am always getting

# puppet agent -t --noop
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Caching catalog for example.com
Error: Failed to apply catalog: 'augparse -I /usr/share/augeas/lenses /usr/share/augeas/lenses/wmtproperties.aug || (rm -f /usr/share/augeas/lenses/wmtproperties.aug && exit 1)' is not qualified and no path was specified. Please qualify the command or specify a path.

This is an ubuntu server with puppet 3. It seems the problem is that puppet is trying to execute the resource before there is an augparse command.

Please provide a way to not check the custom lens(I just commented out the section and it worked)

raphink commented 11 years ago

This exec resource should probably depend on the package indeed.

If you don't need to typecheck your lenses, then it's even easier to not use augeas::lens at all, since the augeas type now supports pluginsync. Just drop your lens in lib/augeas/lenses in the module your choice, and it will get synced even before the catalog is run.

nikolavp commented 11 years ago

Cool, didn't know about this. It might be a good idea to document that this is obsolete if we are using pluginsync(wasn't obvious to me)

Best, Nikola

raphink commented 11 years ago

I think it's documented in Puppet itself (the pluginsync part). That said, I keep using augeas::lens because typechecking your lenses is a really good idea… if you deploy broken/incompatible lenses, Augeas might just get very angry ;-)