I have a chef recipe that can either run on virtual machines or real machines. I need to be able to tell the difference between them inside chef, because I need to treat them differently. I've found something on the internet that said I should just use
if node[:instance_role] == 'vagrant'
but that doesn't seem to work for me. node[:instance_role] is just blank.
Do you know any other way of doing it?
I'm using chef_solo with vagrant provisioning