Re: [Puppet Users] Re: Custom provider woes and questions

2015-12-13 Thread Gareth Rushgrove
On 7 December 2015 at 19:30, Peter Berghold  wrote:
> Nevermind... figured out what was going on..   and fixed that problem and
> now a more bugs to squash...
>
> How do I raise a failed exception in a provider (this before I start
> googleing) :-)
>

You can use the fail method as seen here.

https://github.com/garethr/garethr-digitalocean/blob/master/lib/puppet/provider/droplet/v2.rb#L96

Gareth

> On Mon, Dec 7, 2015 at 9:53 AM Peter Berghold 
> wrote:
>>
>> This email has two parts:
>>
>> First part
>>
>> Looking at "Sh*t Gary Says" seems to imply I may be going about creating
>> custom types/providers.  I am currently creating a type under
>> lib/puppet/type/{typename}.rb without that logic doing anything with the
>> actual logic being in lib/puppet/provider/{typename}/ruby.rb which has
>> worked fine for me in the past.
>>
>> Someone confirm/deny.
>>
>> Second part
>>
>> I've created a pair of custom types/providers, one to set parameters and
>> the other to set state.   The issue I'm running into is the state provider
>> is trying to work and the parameter provider doesn't even seem to be loading
>> in Puppet at all without any sort of error showing up.
>>
>> Here is how they are being invoked in a manifest:
>>
>> myparmtype { 'instance':
>> parm1=>'value1',
>> parm2=>'value2'
>> }
>> ->
>> mystatetype{'instance':
>>state =>'mystate'
>> }
>>
>> Sorry for the obfuscation, but what I'm working on is largely company
>> proprietary.
>>
>> Thoughts anybody?
>>
>> Is there a limit to the number of types/providers a module can have?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAArvnv20aBVzYQyU5ifFJQcuVQPEaCp63VntLMMXBBmP9%3D5SRw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Gareth Rushgrove
@garethr

devopsweekly.com
morethanseven.net
garethrushgrove.com

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAFi_6y%2BGg3K4-%3DnDTxjfrYrhk8d9EA-CxrWS20TBXfmvdWq1uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Custom provider woes and questions

2015-12-08 Thread Corey Osman
I'll be releasing a type/provider generator that creates these files with 
basic code and unit tests in the next release of puppet-retrospec.  You can 
use right now if you want to compile the gem 
yourself. https://github.com/nwops/puppet-retrospec/tree/development. 

Types and providers are documented pretty good inside the source code, so 
if your editor allows you to click on Parent classes and such (Rubymine) 
its a little bit easier to see how things work and the Puppet Types and 
Providers book by Nan Liu and Dan Bode is well written and can help explain 
many things in a somewhat concise way. 


Corey
On Monday, December 7, 2015 at 6:54:19 AM UTC-8, Salty Old Cowdawg wrote:
>
> This email has two parts:
>
> First part
>
> Looking at "Sh*t Gary Says" seems to imply I may be going about creating 
> custom types/providers.  I am currently creating a type under 
> lib/puppet/type/{typename}.rb without that logic doing anything with the 
> actual logic being in lib/puppet/provider/{typename}/ruby.rb which has 
> worked fine for me in the past.  
>
> Someone confirm/deny.
>
> Second part 
>
> I've created a pair of custom types/providers, one to set parameters and 
> the other to set state.   The issue I'm running into is the state provider 
> is trying to work and the parameter provider doesn't even seem to be 
> loading in Puppet at all without any sort of error showing up.
>
> Here is how they are being invoked in a manifest:
>
> myparmtype { 'instance':
> parm1=>'value1',
> parm2=>'value2'
> } 
> -> 
> mystatetype{'instance':
>state =>'mystate'
> } 
>
> Sorry for the obfuscation, but what I'm working on is largely company 
> proprietary. 
>
> Thoughts anybody?   
>
> Is there a limit to the number of types/providers a module can have?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/4cef242b-845a-4ef9-9ffb-01eb4b24f59e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Custom provider woes and questions

2015-12-07 Thread Peter Berghold
Nevermind... figured out what was going on..   and fixed that problem and
now a more bugs to squash...

How do I raise a failed exception in a provider (this before I start
googleing) :-)

On Mon, Dec 7, 2015 at 9:53 AM Peter Berghold 
wrote:

> This email has two parts:
>
> First part
>
> Looking at "Sh*t Gary Says" seems to imply I may be going about creating
> custom types/providers.  I am currently creating a type under
> lib/puppet/type/{typename}.rb without that logic doing anything with the
> actual logic being in lib/puppet/provider/{typename}/ruby.rb which has
> worked fine for me in the past.
>
> Someone confirm/deny.
>
> Second part
>
> I've created a pair of custom types/providers, one to set parameters and
> the other to set state.   The issue I'm running into is the state provider
> is trying to work and the parameter provider doesn't even seem to be
> loading in Puppet at all without any sort of error showing up.
>
> Here is how they are being invoked in a manifest:
>
> myparmtype { 'instance':
> parm1=>'value1',
> parm2=>'value2'
> }
> ->
> mystatetype{'instance':
>state =>'mystate'
> }
>
> Sorry for the obfuscation, but what I'm working on is largely company
> proprietary.
>
> Thoughts anybody?
>
> Is there a limit to the number of types/providers a module can have?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAArvnv20aBVzYQyU5ifFJQcuVQPEaCp63VntLMMXBBmP9%3D5SRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.