I''m making a cups manager type and I''m having trouble figuring out where I should parameters and where I should use properties. The file is at http://github.com/kc7zzv/puppet-cups_printer/blob/master/lib/puppet/type/cups_printer.rb . I was accidentally using "newproperty" and "newparameter" interchangeably, and I''d really like to know which I should be using. Second, the documentation says to define "ensure" as a parameter, but the example I saw seems to do what I''m doing in that file. Which is right? -- 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.
Hi Patrick, On Sun, Aug 22, 2010 at 9:01 PM, Patrick <kc7zzv@gmail.com> wrote:> I''m making a cups manager type and I''m having trouble figuring out where I > should parameters and where I should use properties. The file is at > http://github.com/kc7zzv/puppet-cups_printer/blob/master/lib/puppet/type/cups_printer.rb > . > > I was accidentally using "newproperty" >properties are attributes that can be queried/synchronized. This expects getter/setters to be created. Think about Mode or Owner for the file resource. If a file exists, we can query the current state of these attributes, and possibly sync it.> and "newparameter" >newparam - this is just data that can be used by the provider. Like recurse or force for the file resource (these are not things that are synced) interchangeably, and I''d really like to know which I should be using.> > > Second, the documentation says to define "ensure" as a parameter, but the > example I saw seems to do what I''m doing in that file. >not sure what you mean here.> Which is right? >if you just need absent/present ensure states, then use the ensurable method (expects create/exists?/destroy on the provider). otherwise it should be created as a property. -Dan> -- > 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<puppet-users%2Bunsubscribe@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.
On Aug 22, 2010, at 9:26 PM, Dan Bode wrote:> Hi Patrick, > > On Sun, Aug 22, 2010 at 9:01 PM, Patrick <kc7zzv@gmail.com> wrote: > I''m making a cups manager type and I''m having trouble figuring out where I should parameters and where I should use properties. The file is at http://github.com/kc7zzv/puppet-cups_printer/blob/master/lib/puppet/type/cups_printer.rb . > > I was accidentally using "newproperty" > > properties are attributes that can be queried/synchronized. This expects getter/setters to be created. > > Think about Mode or Owner for the file resource. If a file exists, we can query the current state of these attributes, and possibly sync it. > > and "newparameter" > > newparam - this is just data that can be used by the provider. > > Like recurse or force for the file resource (these are not things that are synced) > > Which is right? > > if you just need absent/present ensure states, then use the ensurable method (expects create/exists?/destroy on the provider). otherwise it should be created as a property.So for example, if you were creating a file resource, you would make path, and mode parameters?> -Dan >-- 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.
On Sun, Aug 22, 2010 at 9:30 PM, Patrick <kc7zzv@gmail.com> wrote:> > On Aug 22, 2010, at 9:26 PM, Dan Bode wrote: > > Hi Patrick, > > On Sun, Aug 22, 2010 at 9:01 PM, Patrick <kc7zzv@gmail.com> wrote: > >> I''m making a cups manager type and I''m having trouble figuring out where I >> should parameters and where I should use properties. The file is at >> http://github.com/kc7zzv/puppet-cups_printer/blob/master/lib/puppet/type/cups_printer.rb >> . >> >> I was accidentally using "newproperty" >> > > properties are attributes that can be queried/synchronized. This expects > getter/setters to be created. > > Think about Mode or Owner for the file resource. If a file exists, we can > query the current state of these attributes, and possibly sync it. > > >> and "newparameter" >> > > newparam - this is just data that can be used by the provider. > > Like recurse or force for the file resource (these are not things that are > synced) > > Which is right? >> > > if you just need absent/present ensure states, then use the ensurable > method (expects create/exists?/destroy on the provider). otherwise it should > be created as a property. > > > So for example, if you were creating a file resource, you would make >> path >would be a parameter.> , and mode parameters? > >mode would be a property.> -Dan > > -- > 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<puppet-users%2Bunsubscribe@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.
On Aug 22, 2010, at 9:33 PM, Dan Bode wrote:> > > On Sun, Aug 22, 2010 at 9:30 PM, Patrick <kc7zzv@gmail.com> wrote: > > On Aug 22, 2010, at 9:26 PM, Dan Bode wrote: > >> Hi Patrick, >> >> Which is right? >> >> if you just need absent/present ensure states, then use the ensurable method (expects create/exists?/destroy on the provider). otherwise it should be created as a property. > > So for example, if you were creating a file resource, you would make > > > path > > would be a parameter. > > , and mode parameters? > > > mode would be a property. > >> -Dan >> >I see now. Thanks for the help. -- 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.