[Puppet Users] Custom providers

2011-01-05 Thread pl
Hi, I have a custom provider that seems to run ok in isolation by itself. In addition, puppet does not complain at all when it runs. However, when I ensure => installed a package the desired package is never installed. There are a few differences between this and something such as the gem provide

[Puppet Users] Re: Custom providers

2011-01-05 Thread pl
On Jan 6, 4:01 pm, pl wrote: >   def install >     output = `sudo -u node sh -c \"export PATH=/home/node/opt/bin:$ > {PATH}; npm install http-console\"` >     if output =~ /npm not ok/ >       raise Puppet::ExecutionFailure, "Failed to install > #{resource[:nam

[Puppet Users] Re: Custom providers

2011-01-09 Thread pl
I have in /var/log/messages is "Provider npm has not defined the 'instances' class method" Is that required? On Jan 6, 4:10 pm, pl wrote: > On Jan 6, 4:01 pm, pl wrote: > > >   def install > >     output = `sudo -u node sh -c \"export PATH=/home/

[Puppet Users] Re: Custom providers

2011-01-10 Thread pl
Hi, > Puppet::Provider::Package defines the prefetch class method. This is > called at the beginning of the puppet run to find matches between existing > packages and the one you described in your manifest. Prefetch calls > instances which should return an array of provider instances. One > provid

[Puppet Users] Re: Custom providers

2011-01-16 Thread pl
Hi, > Puppet::Util::SUIDManager.asuser("username", "group") do > # do stuff here as different user > end Not sure this works how you suggested as this Puppet::Util::SUIDManager.asuser("userx", "userx") do execpipe("whoami") do |output| Will report root, not userx. I'll check th

[Puppet Users] Re: Custom providers

2011-01-17 Thread pl
Hi, > Can you instrument your code to > dump Process.uid and Process.gid from Ruby-space in the block?  That > way we can help narrow down where things are going wrong. Process.uid was telling me 500, which was the intended user. whoami inside the execpipe was root though. I've ended up doing th

[Puppet Users] force backup of config files

2009-03-31 Thread PL
This is the situation: We have a bunch of config files. We check if mtime changed. The line written in syslog is trapped by a monitoring tool and someone is warned. This works fine... What we want is 1. to backup the file when mtime has changed (and keep x versions) 2. execute a diff between ne