When I did some work on Puppet, I found the concept of the file
server hella confusing as I had come from Chef. I also found the
documentation on where to put template files and file-files
confusing. (You should put templates in X dir but Puppet will look
for them in Y dir first, WAT?) In Chef, when you have a file or template associated with a cookbook, you can simply drop them in <cookbook>/templates/default and <cookbook>/files/default. There are more complex use cases as well, however, 99% of the time the default directory is good enough for what you want. When referencing the files in recipes, you use the "source" attribute and chef will figure out where the file is starting by looking in those default cookbook directories. cookbook_file "/etc/blah/blah.config" do source "blah.config" end This is all in the resource reference page, but I figured it was worth talking about in more detail if you are used to Puppet and a file server. Chef and Puppet seem to come at this from odd directions if you are used to one over the other. I actually started a Puppet for Chef users series on my blog and was going to talk about files and templates, but figuring it out for Puppet kind of gave me some ragefaces. And by the time I was over it, I was working on something else. I may revisit. Sascha On 8/2/12 7:29 AM, Morgan Blackthorne wrote: " type="cite">Thanks, but I'm a bit more used to Puppet. Where can I put the actual file in Chef to push it to the node? I'd like to autoconfigure the node completely with Chef. Does that go in a databag, or a template, or? |
Archive powered by MHonArc 2.6.16.