I'm working on spinning up a cluster of nodes. In myrepo/cookbooks/mycookbook/.kitchen.yml
I have
driver:
name: vagrant
provisioner:
name: chef_zero
roles_path: '../../roles'
environments_path: '../../environments'
data_bags_path: '../../data_bags'
platforms:
- name: ubuntu-12.04
suites:
- name: node01
driver:
vm_hostname: "node01.localhost"
run_list:
- role[genericnode]
provisioner:
client_rb:
environment: development
In myrepo/cookbooks/mycookbook/recipes/default.rb
I have
nodes = []
search(:node, 'role:genericnode').each do |node|
nodes.push("http://#{node['ipaddress']}:8080")
end
node.default['mysetting'] = nodes.join(',')
In my development environment, though, search returns an empty list. Do I need more than the .kitchen.yml
settings above to be able to access the ip addresses of the nodes in my network with the role genericnode
?
Additional information:
Here's the role:
{
"name": "genericnode",
"description": "Generic Node",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
},
"chef_type": "role",
"run_list": [
"recipe[apt::default]", "recipe[mycookbook::default]"
],
"env_run_lists": {
}
}