On 25.06.2010 12:00, Jean-Baptiste Barth wrote:
Hi,

I'd like to be able to deploy a skeleton directory through puppet, i.e. puppet deploys it only if it does not exist.

I tried this :
file {"/path/to/this/directory":
  source => "puppet:///files/path/to/the/skeleton",
  ensure => directory,
  recurse => true,
  owner => auser,
  group => agroup
}

But I have 2 problems for the moment :
- if I don't set owner/group, it takes uid/gid on the puppetmaster, which does not exist on the node ; if I do set these options, the directory is scanned each time and all files are chown'ed to this user/group, which is absolutely not desired behaviour in my case (puppet should not change ownership for files it doesn't manage in my case...)
Change the ownership of the files on the server (but this implies that the users exists on the server too). Second what puppet version? There were some bugs in older versions that made puppet hash all the files in a folder if the folder was maintained by puppet, maybe that's the problem in your case. Also try changing the hash property of file. If you want that folder under a certain user you should allow puppet to ensure that.
- I'd like puppet to let user change some files in the skeleton as they want, i.e. skip this directory if it just exists
This is not possible, and would break the way puppet works if it were to be implemented. Usually local changes can be integrated through the use of the concat module (see puppet forge). But I don't know your real usage of the files so it may be different. If you post what you need to do maybe someone would give you a better idea of achieving just that.

You may try to create a file/fact for puppet to indicate that it shouldn't touch that folder on that computer. Other than that no ideas, but again post a more concrete usage scenario. Also maybe puppet isn't the right tool for you since it works by ensuring some specific settings, not allowing local changes. Maybe you need to generalize you manifests instead of allowing local changes.

Welcome to puppet ;) ,
Silviu

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to