Re: [Puppet Users] help writing types/provider

2011-01-21 Thread Stefan Schulte
When you look into puppet source type.rb, ensurable accept a block. If you pass a block like this ensurable do [...] end it is exactly the same as if you'd written newproperty(:ensure, :parent => Puppet::Property::Ensure) do [...] end If you do not pass a block puppet will fill

Re: [Puppet Users] help writing types/provider

2011-01-21 Thread Dan Bode
On Fri, Jan 21, 2011 at 11:13 AM, Dick Davies wrote: > Thanks for point 2, much appreciated. Is the 'global' validate > option documented anywhere? > ummm.. maybe. > on point 1, using the 'ensurable' magic means I don't have anywhere > to stick the defaultto keyword (I tried > > ensurable do >

Re: [Puppet Users] help writing types/provider

2011-01-21 Thread Dick Davies
Thanks for point 2, much appreciated. Is the 'global' validate option documented anywhere? on point 1, using the 'ensurable' magic means I don't have anywhere to stick the defaultto keyword (I tried ensurable do defaultto 'present' end but didn't seem to do the trick (blows up with a "change

Re: [Puppet Users] help writing types/provider

2011-01-21 Thread Dan Bode
On Fri, Jan 21, 2011 at 8:31 AM, Dick Davies wrote: > I've almost finished a pretty simple type/provider to manage > RabbitMQ users and virtual hosts. > I'm using the 'ensurable' keyword in my type to save a bit of boilerplate. > > Type is below (the provider is just a wrapper around the 'rabbitmq

[Puppet Users] help writing types/provider

2011-01-21 Thread Dick Davies
I've almost finished a pretty simple type/provider to manage RabbitMQ users and virtual hosts. I'm using the 'ensurable' keyword in my type to save a bit of boilerplate. Type is below (the provider is just a wrapper around the 'rabbitmqctl' command. Have a feeling there's a developer guide somewh