Gonzalo Servat
2011-Nov-15 05:48 UTC
[Puppet Users] Adding a parameter to a custom Puppet type/provider
Hi All, I''ve downloaded a Puppet module and I''m trying to add a parameter to it by editing lib/puppet/type/<resource>.rb. I simply added: newproperty(:pcfree) do desc "My description here" end In the corresponding file in lib/puppet/provider, I do something with :pcfree. Whenever I call the resource from Puppet with my new parameter, it keeps saying "Invalid parameter pcfree". Do I have to define the new parameter in any other file? Thanks in advance. - Gonzalo -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Gonzalo Servat
2011-Nov-15 06:10 UTC
[Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
... and I just found this ( http://docs.puppetlabs.com/guides/troubleshooting.html): err: Could not retrieve catalog: Invalid parameter ‘foo’ for type ‘bar’ When you are developing new custom types, you should restart both the puppetmasterd and the puppetd before running the configuration using the new custom type. The pluginsync feature will then synchronise the files and the new code will be loaded when both daemons are restarted. Restarted puppetmaster and it''s now OK. Caused me many hours of grief!! - Gonzalo On Tue, Nov 15, 2011 at 4:48 PM, Gonzalo Servat <gservat@gmail.com> wrote:> Hi All, > > I''ve downloaded a Puppet module and I''m trying to add a parameter to it by > editing lib/puppet/type/<resource>.rb. I simply added: > > newproperty(:pcfree) do > desc "My description here" > end > > In the corresponding file in lib/puppet/provider, I do something with > :pcfree. > > Whenever I call the resource from Puppet with my new parameter, it keeps > saying "Invalid parameter pcfree". > > Do I have to define the new parameter in any other file? > > Thanks in advance. > > - Gonzalo >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jason Koppe
2011-Dec-06 18:22 UTC
[Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
restarting the puppet master didn''t help me. On Nov 15, 12:10 am, Gonzalo Servat <gser...@gmail.com> wrote:> ... and I just found this (http://docs.puppetlabs.com/guides/troubleshooting.html): > err: Could not retrieve catalog: Invalid parameter ‘foo’ for type ‘bar’ > > When you are developing new custom types, you should restart both the > puppetmasterd and the puppetd before running the configuration using the > new custom type. The pluginsync feature will then synchronise the files and > the new code will be loaded when both daemons are restarted. > > Restarted puppetmaster and it''s now OK. Caused me many hours of grief!! > > - Gonzalo > > > > > > > > On Tue, Nov 15, 2011 at 4:48 PM, Gonzalo Servat <gser...@gmail.com> wrote: > > Hi All, > > > I''ve downloaded a Puppet module and I''m trying to add a parameter to it by > > editing lib/puppet/type/<resource>.rb. I simply added: > > > newproperty(:pcfree) do > > desc "My description here" > > end > > > In the corresponding file in lib/puppet/provider, I do something with > > :pcfree. > > > Whenever I call the resource from Puppet with my new parameter, it keeps > > saying "Invalid parameter pcfree". > > > Do I have to define the new parameter in any other file? > > > Thanks in advance. > > > - Gonzalo-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jason Koppe
2011-Dec-06 18:34 UTC
[Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
http://pastie.org/private/t9nl5wa91bd6rx1afad7sq is a pastie of my changes to https://github.com/puppetlabs/puppet-lvm and the error i''m seeing is err: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter physical_volume at file.pp:26 at node On Dec 6, 12:22 pm, Jason Koppe <jason.robert.ko...@gmail.com> wrote:> restarting the puppet master didn''t help me. > > On Nov 15, 12:10 am, Gonzalo Servat <gser...@gmail.com> wrote: > > > > > > > > > ... and I just found this (http://docs.puppetlabs.com/guides/troubleshooting.html): > > err: Could not retrieve catalog: Invalid parameter ‘foo’ for type ‘bar’ > > > When you are developing new custom types, you should restart both the > > puppetmasterd and the puppetd before running the configuration using the > > new custom type. The pluginsync feature will then synchronise the files and > > the new code will be loaded when both daemons are restarted. > > > Restarted puppetmaster and it''s now OK. Caused me many hours of grief!! > > > - Gonzalo > > > On Tue, Nov 15, 2011 at 4:48 PM, Gonzalo Servat <gser...@gmail.com> wrote: > > > Hi All, > > > > I''ve downloaded a Puppet module and I''m trying to add a parameter to it by > > > editing lib/puppet/type/<resource>.rb. I simply added: > > > > newproperty(:pcfree) do > > > desc "My description here" > > > end > > > > In the corresponding file in lib/puppet/provider, I do something with > > > :pcfree. > > > > Whenever I call the resource from Puppet with my new parameter, it keeps > > > saying "Invalid parameter pcfree". > > > > Do I have to define the new parameter in any other file? > > > > Thanks in advance. > > > > - Gonzalo-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Stefan Schulte
2011-Dec-07 12:01 UTC
Re: [Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
On Tue, Dec 06, 2011 at 10:34:47AM -0800, Jason Koppe wrote:> http://pastie.org/private/t9nl5wa91bd6rx1afad7sq is a pastie of my > changes to https://github.com/puppetlabs/puppet-lvm and the error i''m > seeing is > > err: Could not retrieve catalog from remote server: Error 400 on > SERVER: Invalid parameter physical_volume at file.pp:26 at node >Parameter validation happens on your puppet master so I guess you have to update /var/lib/puppet/lib/puppet/type/logical_volume.rb on your master first. -Stefan
Jason Koppe
2012-Feb-11 15:31 UTC
Re: [Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
I do have /var/lib/puppet/lib/puppet/type/logical_volume.rb on my puppet master and I still get the same error. On Wed, Dec 7, 2011 at 6:01 AM, Stefan Schulte < stefan.schulte@taunusstein.net> wrote:> On Tue, Dec 06, 2011 at 10:34:47AM -0800, Jason Koppe wrote: > > http://pastie.org/private/t9nl5wa91bd6rx1afad7sq is a pastie of my > > changes to https://github.com/puppetlabs/puppet-lvm and the error i''m > > seeing is > > > > err: Could not retrieve catalog from remote server: Error 400 on > > SERVER: Invalid parameter physical_volume at file.pp:26 at node > > > > Parameter validation happens on your puppet master so I guess you have > to update > > /var/lib/puppet/lib/puppet/type/logical_volume.rb > > on your master first. > > -Stefan >-- Jason Koppe Jason.Robert.Koppe@gmail.com Cell (210) 445-8242 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Stefan Schulte
2012-Feb-11 16:21 UTC
Re: [Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
Can you provide your resource definition where you use the logical_volume type? -Stefan On Sat, Feb 11, 2012 at 09:31:36AM -0600, Jason Koppe wrote:> I do have /var/lib/puppet/lib/puppet/type/logical_volume.rb on my puppet > master and I still get the same error. > > On Wed, Dec 7, 2011 at 6:01 AM, Stefan Schulte < > stefan.schulte@taunusstein.net> wrote: > > > On Tue, Dec 06, 2011 at 10:34:47AM -0800, Jason Koppe wrote: > > > http://pastie.org/private/t9nl5wa91bd6rx1afad7sq is a pastie of my > > > changes to https://github.com/puppetlabs/puppet-lvm and the error i''m > > > seeing is > > > > > > err: Could not retrieve catalog from remote server: Error 400 on > > > SERVER: Invalid parameter physical_volume at file.pp:26 at node > > > > > > > Parameter validation happens on your puppet master so I guess you have > > to update > > > > /var/lib/puppet/lib/puppet/type/logical_volume.rb > > > > on your master first. > > > > -Stefan > > > > > > -- > Jason Koppe > Jason.Robert.Koppe@gmail.com > Cell (210) 445-8242 > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jason Koppe
2012-Feb-12 21:06 UTC
[Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
Added to the pastie: http://pastie.org/private/em9dve6walcxyfjyssvya On Feb 11, 10:21 am, Stefan Schulte <stefan.schu...@taunusstein.net> wrote:> Can you provide your resource definition where you use the > logical_volume type? > > -Stefan > > > > > > > > On Sat, Feb 11, 2012 at 09:31:36AM -0600, Jason Koppe wrote: > > I do have /var/lib/puppet/lib/puppet/type/logical_volume.rb on my puppet > > master and I still get the same error. > > > On Wed, Dec 7, 2011 at 6:01 AM, Stefan Schulte < > > stefan.schu...@taunusstein.net> wrote: > > > > On Tue, Dec 06, 2011 at 10:34:47AM -0800, Jason Koppe wrote: > > > >http://pastie.org/private/t9nl5wa91bd6rx1afad7sqis a pastie of my > > > > changes tohttps://github.com/puppetlabs/puppet-lvmand the error i''m > > > > seeing is > > > > > err: Could not retrieve catalog from remote server: Error 400 on > > > > SERVER: Invalid parameter physical_volume at file.pp:26 at node > > > > Parameter validation happens on your puppet master so I guess you have > > > to update > > > > /var/lib/puppet/lib/puppet/type/logical_volume.rb > > > > on your master first. > > > > -Stefan > > > -- > > Jason Koppe > > Jason.Robert.Ko...@gmail.com > > Cell (210) 445-8242 > > > -- > > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > > For more options, visit this group athttp://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
xkrantz
2012-Aug-06 19:42 UTC
[Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
Hi Jason, Did you find a solution to your issue ? Because I''m facing the same, and I would be very glad to have some feed back :) Thanks in advance, Le dimanche 12 février 2012 22:06:46 UTC+1, Jason Koppe a écrit :> > Added to the pastie: http://pastie.org/private/em9dve6walcxyfjyssvya > > On Feb 11, 10:21 am, Stefan Schulte <stefan.schu...@taunusstein.net> > wrote: > > Can you provide your resource definition where you use the > > logical_volume type? > > > > -Stefan > > > > > > > > > > > > > > > > On Sat, Feb 11, 2012 at 09:31:36AM -0600, Jason Koppe wrote: > > > I do have /var/lib/puppet/lib/puppet/type/logical_volume.rb on my > puppet > > > master and I still get the same error. > > > > > On Wed, Dec 7, 2011 at 6:01 AM, Stefan Schulte < > > > stefan.schu...@taunusstein.net> wrote: > > > > > > On Tue, Dec 06, 2011 at 10:34:47AM -0800, Jason Koppe wrote: > > > > >http://pastie.org/private/t9nl5wa91bd6rx1afad7sqis a pastie of my > > > > > changes tohttps://github.com/puppetlabs/puppet-lvmand the error > i''m > > > > > seeing is > > > > > > > err: Could not retrieve catalog from remote server: Error 400 on > > > > > SERVER: Invalid parameter physical_volume at file.pp:26 at node > > > > > > Parameter validation happens on your puppet master so I guess you > have > > > > to update > > > > > > /var/lib/puppet/lib/puppet/type/logical_volume.rb > > > > > > on your master first. > > > > > > -Stefan > > > > > -- > > > Jason Koppe > > > Jason.Robert.Ko...@gmail.com > > > Cell (210) 445-8242 > > > > > -- > > > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > > > To post to this group, send email to puppet-users@googlegroups.com. > > > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > > > For more options, visit this group athttp:// > groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/yuka4GM7UZIJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Josh Cooper
2012-Aug-07 04:32 UTC
Re: [Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
Hi Stefan, On Wed, Dec 7, 2011 at 4:01 AM, Stefan Schulte <stefan.schulte@taunusstein.net> wrote:> Parameter validation happens on your puppet master so I guess you have > to update > > /var/lib/puppet/lib/puppet/type/logical_volume.rb > > on your master first.Recently Nick L and I "discovered" that parameter validation does not occur on the master (in 2.7.x) yet many people believe this to be true. Specifically the munge and validate methods for parameters and properties are not called on the puppet master. However, the type & provider code is loaded, so for example, requiring a windows gem at the top level would prevent the master (not running windows) from being able to compile catalogs. Did puppet actually used to invoke the validate method on the master, e.g. before 2.6? Or is that just how people thought/think it should work? Josh -- Josh Cooper Developer, Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2012-Aug-07 13:44 UTC
Re: [Puppet Users] Re: Adding a parameter to a custom Puppet type/provider
On Monday, August 6, 2012 11:32:38 PM UTC-5, Josh Cooper wrote:> > Recently Nick L and I "discovered" that parameter validation does not > occur on the master (in 2.7.x) yet many people believe this to be > true. Specifically the munge and validate methods for parameters and > properties are not called on the puppet master. However, the type & > provider code is loaded, so for example, requiring a windows gem at > the top level would prevent the master (not running windows) from > being able to compile catalogs. > > Did puppet actually used to invoke the validate method on the master, > e.g. before 2.6? Or is that just how people thought/think it should > work? >In 0.24.8 there were Puppet parameters "typecheck" and "paramcheck" defined in defaults.rb, both initialized to true, and documented to control "Whether to validate types during parsing" and "Whether to validate parameters during parsing", respectively. These do not appear to actually have been used in that version, however. Without digging through the code, I''m not certain whether that means parse-time type and parameter checking were always on or always off. To the extent that validation is a function of the type, as opposed to the selected provider, I would expect it to be performed by the master. I can see some reasons why it might make sense for the agent to perform such type-level validations again, but not to excuse the master from doing them. I find it surprising that the master loads providers. On the other hand, it should be *possible* for Puppet (any face) to load any installed provider, including those that are not applicable to the host on which it is running. I take this as part of Puppet''s contract with providers, thus the responsibility of the provider author. On the flip side, it is (should be) Puppet''s responsibility to check provider applicability after loading, and to avoid using inapplicable providers for any purpose. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/fl7EAZoVkWUJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.