I wanted to have a way to specify some attributes based on whether or not I was running in Vagrant. According to other resources on the web it looks like Vagrant used to set the vagrant attribute for us but no longer does so we need to manually specify it.
Vagrantfile
...
config.vm.provision :chef_solo do |chef|
chef.json = {
vagrant: true
}
chef.run_list = [
"recipe[my_site::default]"
]
end
...
Your Chef attributes file
if node.attribute?('vagrant')
default['openssh']['server']['port'] = "22"
else
default['openssh']['server']['port'] = "8437"
end