-
Notifications
You must be signed in to change notification settings - Fork 213
Respect chef-solo-search paths #117
Comments
Oh woah, I didn't notice that and assumed it only did data bag searching. Interesting trick :) I'd be willing to go with that, though we will probably have to allow a fallback to |
Btw, why are they use |
Couldn't hurt to ask. Seems like it could be just a style decision. On Oct 25, 2012, at 15:18, Anton Orel notifications@github.com wrote: Btw, why are they use node instead of nodes path inside data_bags? Maybe it — |
I'm sure you've all figured this out already, but I symlink'd |
Actually on further inspect the symlink won't work. chef-solo-search expects the node json files to be in this format: {
"id": "vagrant",
"name": "vagrant-vm",
"chef_environment": "_default",
"json_class": "Chef::Node",
"chef_type": "node",
"automatic": {},
"normal": {},
"default": {
"attribute": "value"
},
"override": {},
"run_list": [
"role[monitoring]"
]
} while {
"attribute": "value",
"run_list": [
"role[monitoring]"
]
} I've opened a pull request for chef (chef/chef#673) to allow the We could generate the smaller json files from the large ones when we call large_json = JSON.parse(File.read('large.json'))
small_json = Chef::Node.json_create(large_json).to_hash.to_json @skyeagle I think it was named |
@tjwallace thanks for investigation and clear explanation. |
@tjwallace wow, nice job! After #199 the symlink on the local machine does not help any more, but that is not a problem as we will control the directory names on the node and thus we can use "node" instead of "nodes", even if it is inconsistent with other names. |
Ah it is './data_bags/node/', not './node/'. Not enough coffee yet. |
I've created a pull request on chef-solo-search (edelight/chef-solo-search#19) that would allow node files written in both formats to be searchable. This would allo the As an interm solution, I've created a symlink from |
@tjwallace did you see the previous commit on that file? Isn't that already enough? And as I said, the symlink won't work in the next knife-solo release, as we won't sync the whole directory structure any more. |
@tmatilai no Also it looks like #199 will sync the entire |
OK, I haven't looked at all what those methods do. Just saw the commit message.
Ah, you're right! Still smells a bit of a kludge. =) |
@tjwallace Now that we have full control of solo.rb this is easier to address. I think we could:
I created edelight/chef-solo-search#28 to be able to pass our uploaded nodes directory to chef-solo-search, but that is not a blocker for this issue. Then I had a wild idea that we could maybe even allow chef-solo run to save updated node attributes to the original name.json by overriding |
@tmatilai I like the idea of generating simplified |
There is some discrepancy. The chef-solo-search uses data bags for nodes data but this gem uses
nodes
root path pointed out in readme.The text was updated successfully, but these errors were encountered: