I am developing a cook cookbook that I am testing with Vagrant and chef-solo. Recipes look at node.name to make specific decisions. To test the various options for this, I would like to override this attribute for test runs from Vagrant. So I tried
Vagrant.configure("2") do |config| ... config.vm.provision :chef_solo do |chef| ... chef.json = { 'name' => 'randomhostname', } end end
but it seems to have no effect.
I understand that the name attribute by default has a hostname attribute that ohai controls (see also this question ), but is there a way to override the name attribute?
source share