[chef] Re: Re: Different data_bags in production and test-kitchen


Chronological Thread 
  • From: Teemu Matilainen < >
  • To:
  • Subject: [chef] Re: Re: Different data_bags in production and test-kitchen
  • Date: Fri, 21 Feb 2014 02:11:02 -0300

On Thu, Feb 20, 2014 at 3:49 PM, Lamont Granquist < " target="_blank"> > wrote:
you can 'detect' running on vagrant by looking for the presence of the vagrant user:

sudo "vagrant" do
  user "vagrant"
  only_if { Etc.getpwent("vagrant") }
end

Worth noting that while this is the default on for example VirtualBox boxes, the username is configurable. Especially with cloud providers like vagrant-aws the odds are that the login user is something else.

Unfortunately I don't know any reliable way to detect when running on Vagrant. Earlier versions set node["instance_role"] to "vagrant" but I don't know why that was removed in Vagrant 1.1.

-- 
Cheers,
  - Teemu



Archive powered by MHonArc 2.6.16.

§