[chef] Re: Re: Re: Re: Manage role-node association with scm?


Chronological Thread 
  • From: Lamont Granquist < >
  • To: < >
  • Subject: [chef] Re: Re: Re: Re: Manage role-node association with scm?
  • Date: Fri, 9 Aug 2013 09:18:18 -0700


i think you need to set cookbook_path, role_path, data_bag_path and environment_path in your knife.rb, i think you're missing environment_path.  even if you don't use environments you'll still get _default downloaded.

On 8/9/13 2:07 AM, Tommaso Visconti wrote:
" type="cite">
This is great! I was using 11.4 and the node download feature was absent.
I've now a little problem with `knife download /`, this is the output:

~ knife download /
Created clients
Created nodes
Created users
Created roles/base.json
[...]
ERROR: Errno::ENOENT: No such file or directory - /var/chef/environments

what's knife looking for in that folder? in knife.rb there's no trace of that path.

Thanks



2013/8/8 Lamont Granquist < " target="_blank"> >

"knife download /nodes" will download all your nodes into your chef-repo

http://docs.opscode.com/knife_download.html

you can also just "knife download /" to get everything which will pull down nodes, roles, data_bags, cookbooks, environments, acls, clients, groups, and containers as well...

available in chef-client in 11.6, i think its available for everyone else in the knife-essentials gem


On 8/8/13 7:31 AM, Brad Knowles wrote:
On Aug 8, 2013, at 8:33 AM, Tommaso Visconti < " target="_blank"> > wrote:

knife node run_list add <mynode> "role[cool_role]"

but this doesn't leave any trace in the chef-repo files, so it's impossible to save the associations in the SCM.
Is it possible to use ruby/json files to manage the nodes' roles? Or the only ways are knife and the chef-server web interface?
Well, "knife role from file" will get you the roles themselves stored in a format that you can check into the SCM, but that doesn't help with the information about the nodes and what roles have been applied to them.

What I've done in the past is to do a "knife node edit" any time I wanted to add a role or delete a role from a node, or otherwise make changes to the runlist on a node.  But you're right that this information isn't checked into an SCM anywhere.  You could dump the information from a "knife node show nodename -l" into a file format that could be checked into an SCM, but most of the information will be auto-discovered by ohai, and you really want to let ohai do the job you're asking it to do.


For my part, I considered this information about the node itself to be fairly ephemeral, and the information available from the Chef database regarding the roles, runlists, and other details about a node has been sufficient.  So long as Chef keeps track of what is applied to what node, I haven't really cared.

I tried to solve the problem reading the docs, but they are really a lot and I didn't find anything useful for this :|
The search interface on docs.opscode.com is decent, but it definitely has limits.  If you know a keyword or two, that's usually enough to get you to a set of pages, one of which is likely to have information that leads you to an answer for your question.  But if you don't know what you're looking for, or it's more specific than can be crammed into just a keyword or two, then you're less likely to be successful.

--
Brad Knowles < " target="_blank"> >
LinkedIn Profile: <http://tinyurl.com/y8kpxu>







Archive powered by MHonArc 2.6.16.

§