On 24 Apr 2014 18:21, "Matthias Saou" <[email protected]> wrote: > > On Thu, 24 Apr 2014 18:41:05 +0200 > José Luis Ledesma <[email protected]> wrote: > > > Idk if i did understand correctly, but there is the replace parameter > > in the file resource that may help here. > > I think you've missed the important bit, like I did initially : The > "replace" parameter set to false will have puppet *never* touch the > file once it's created. What the OP wants it to have puppet keep > updating the file *until it's modified locally*, at which point it > should stop. > > Tricky. I can't think of any simple and clean solution from the top of > my head, though I do understand why one would want to do that... I > could actually use that behaviour for the initial ~/.gitconfig files I > create for system users, for example.
For files in user's home directories I would manage the skeleton files using puppet and then when the user account is created they'll be copied into their home directory. That obviously only works for new users though. It won't account for existing users or for updating the file if it hasn't been touched by the user yet. It's perhaps a little painful but could you put a comment marker in each file you manage and then have a custom fact that checks for that marker? That is then used to determine whether the File resource is managed or not. Users would have to be told (probably in that same comment marker) that any changes to the file will be undone unless they remove the comment. Matt -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAKUTv3K385xP041NoXyB-PxGkhw2ypb1m88Y%3D04S4%2BLbJYPhAA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
