For reference, I had a chat to Andrew about this in IRC, and no really satisfactory solution was raised.
I ended up managing reading/writing the file contents inside the provider without making use of the File type. On Tue, Nov 11, 2008 at 10:25 AM, Andrew Shafer <[EMAIL PROTECTED]> wrote: > > Nigel, > > In the transaction there is a call to 'generate', which will look at all the > resources and call generate on the ones that can respond to it. The result > of generate is an array of resources that will get added to the catalog for > that transaction. > > In general, you should be able to add a generate method to the type/provider > and return the file resource in an array. Since this is the user type, I'm > interested to see Luke's opinion on the most appropriate way to do this. > > Regards, > Andrew > > > > On Tue, Nov 11, 2008 at 10:48 AM, Nigel Kersten <[EMAIL PROTECTED]> wrote: >> >> So I'm working on changing the directoryservice provider for users so >> that it doesn't use clear text passwords, but instead takes a hash. >> >> Mac OS X stores password hashes in separate files per user, so I was >> thinking rather than repeating code Puppet already does, that it would >> make sense to instantiate a File resource for the password hash file >> for that user. >> >> I'm having trouble working out exactly how to do this. >> >> This sort of code seems to create the right kind of object... >> >> require 'puppet' >> require 'puppet/type/file' >> >> myfile = Puppet::Type.newfile :path => "/tmp/spam", >> :ensure => :file, >> :backup => false, >> :content => "eggs" >> >> >> but I'm unsure how to best bring this resource actually into sync... >> the write method for the file type looks promising, but requires >> specifying the content again, which makes me think this is the wrong >> path to take. >> >> Do I really need to create a stub catalog and a transaction by >> applying the catalog? Is there some better way I should be doing this? >> >> >> >> -- >> Nigel Kersten >> Systems Administrator >> Tech Lead - MacOps >> >> > > > > > -- Nigel Kersten Systems Administrator Tech Lead - MacOps --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---