On Aug 8, 2013, at 8:33 AM, Tommaso Visconti < "> > wrote: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.
> 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?
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.
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.
> I tried to solve the problem reading the docs, but they are really a lot and I didn't find anything useful for this :|
--
Brad Knowles < "> >
LinkedIn Profile: <http://tinyurl.com/y8kpxu>
Archive powered by MHonArc 2.6.16.