jcbollinger
2009-Jul-11 00:04 UTC
[Puppet Users] Resource / provider protocol for resource creation
As I mentioned in another thread, I am working on a custom provider for the User resource. After having worked out that I needed a delete () method rather than a destroy() method, nearly everything is working: Removing a User with ensure => ''absent'', Updating an existing user via all property bindings supported by the provider, and Adding a User with ensure => ''present'' -- *almost* I find that when Puppet creates a User resource is created for which no existing data can be prefetched, the properties bound to that User are never written to the provider. My provider successfully creates the user in that case, but it doesn''t have the right home directory, shell, etc. A subsequent puppet run notices the discrepancies and fixes them, so my provider accepts the properties and outputs them correctly in that case. I see that when adding users, at least some of the other User providers get property values by peeking at @resource.should, instead of by relying on the resource to update them with the correct values. I guess mine can do that, too, but it seems wrong. Is User unusual in this way, or is that normal resource behavior? Or have I screwed something up? Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---