Hi,
I’ve got a few questions around how to manage workflow. We are new to chef so don’t have past experience with other work flows, just what we could read about on the interwebs. We started down the single cookbook per git repo plan. We are busy writing cookbooks to get our app/site working by end of the month, but we don’t have a good idea/plan how to manage them all. I started experimenting with policyfiles and provisioning instead of berkshelf. We don’t use environments/roles yet, might not at all.
We want to have a local test env, a qa env, and production env. We are using hosted/managed chef.
What we have now:
- A chef repo checked into git. This repo started out just having knife.rb file and was meant to be used by anyone to create and configure our website either locally on a laptop or in AWS.
- This repo has a policies dir that contains a policy file per node:
policies/webserver.rb policies/database.rb
- There is a cookbook in this repo called cluster-provision that contains various recipes to create nodes using vagrant or AWS. I haven’t figured out how to make once recipe do either one yet… still learning.
I can run commands like:
chef provision qa --sync policies/webserver.rb -n web-qa --cookbook cookbooks/cluster-provision --recipe setup_vagrant_webserver
or:
chef provision qa --sync policies/database.rb -n web-qa --cookbook cookbooks/cluster-provision --recipe setup_vagrant_webserver
or:
chef provision production --sync policies/database.rb -n web-qa --cookbook cookbooks/cluster-provision --recipe setup_aws_webserver
Great. Question here… I can’t see the policyfile on the Chef Manage website. I can’t see cookbooks either. I can see policies using chef show-policy
. Using knife I can’t see anything either. Is this just some missing work/feature preventing it from working? Or are you supposed to take the id shown by show-policy and use it to examine policy lock file to figure out what’s going on?
In the policyfiles, I reference about four of our own cookbooks. Right now I’m using either git reference or a local file path reference. Great. Can I point the policyfile cookbook entries at chef server to get cookbooks? We don’t have a local/private supermarket.
In each of our own cookbooks do we need to have a policyfile to resolve deps and upload them to chef server? Or is that still done using Berksfile/berkshelf?
Some of the sources I’ve used/found so far are:
Chef mailing list: policyfiles-and-chef-provision
Policy Files Guided Tour
I have seen some other topics on chef mailing list about policyfiles but still not clear to me how to setup a workflow. Maybe part of it is not having experience with chef and other workflows is part of it. Thanks in advance.
-Maciej