README.md in kitchen-nodes-0.2.0 vs README.md in kitchen-nodes-0.3.0

- old
+ new

@@ -11,10 +11,13 @@ "id": "server-community-ubuntu-1204", "automatic": { "ipaddress": "172.17.0.8", "platform": "ubuntu" }, + "normal": { + "attr1": "val1" + } "run_list": [ "recipe[apt]", "recipe[couchbase-tests::ipaddress]", "recipe[couchbase::server]", "recipe[export-node]" @@ -34,24 +37,28 @@ "recipe[export-node]" ] } ``` -## <a name="installation"></a> Installation and Setup +The node data includes the node id based on the test-kitchen suite name, the run list assigned to the node, the normal attributes included in the `.kitchen.yml` file, the externally reachable ip address and the platform of the test instance os. -Please read the [Driver usage][driver_usage] page for more details. +## <a name="installation"></a> Installation +``` +gem install kitchen-nodes +``` + ## <a name="config"></a> Configuration Use `nodes` instead of `chef-zero` for the kitchen provisioner name. ``` provisioner: name: nodes ``` -## <a name="installation"></a> Usage +## <a name="Usage"></a> Usage Using `kitchen-nodes` one can expect all previously converged nodes to be represented in a node file and be searchable. For example consider this scenario looking for a primary node in a cluster in order to add a node to join: ``` require 'timeout' @@ -75,9 +82,34 @@ primary = search_for_nodes("run_list:*couchbase??server* AND platform:#{node['platform']}") node.normal["couchbase-tests"]["primary_ip"] = primary[0]['ipaddress'] ``` +### <a name="vagrant"></a> Using with Vagrant + +When using kitchen-nodes with the vagrant driver, make sure you add the following to your `driver_config`: + +``` +network: + - ["private_network", { type: "dhcp" }] +``` + +This will add an additional non-NAT NIC to your vagrant box with an IP reachable from the host and other test nodes. + +### <a name="virtualbox"></a> Why is my ohai `ipaddress` different from my node ipaddress on vagrant with VirtualBox? + +Ohai will pick up the localhost ipaddress on vagrant boxes using virtualbox. To reset the `node["ipaddress"]` to the reachable ip, add `hurry-up-and-test::set_non_nat_vbox_ip` to the top of your `run_list`. + +``` +suites: + - name: my-suite + run_list: + - recipe[hurry-up-and-test::set_non_nat_vbox_ip] + - recipe[cookbook-under-test] +``` + +You can add this even if you do not use virtualbox and the recipe will do nothing. + ## <a name="development"></a> Development * Source hosted at [GitHub][repo] * Report issues/questions/feature requests on [GitHub Issues][issues]