[chef] Re: Re: Vagrant/EC2 in attributes.


Chronological Thread 
  • From: Fabien Delpierre < >
  • To:
  • Subject: [chef] Re: Re: Vagrant/EC2 in attributes.
  • Date: Fri, 6 Feb 2015 16:46:37 -0500

Maybe this won't work for you, but if you're using Amazon Linux when running stuff in EC2, you can just check if node.platform == "amazon". If yes, do this, if not, do that instead.
As far as I know, Amazon Linux is not available outside of EC2, so anything running on your machine would, by default, be not-Amazon Linux. And of course my comment is useless if you don't use Amazon Linux to begin with.

On Fri, Feb 6, 2015 at 4:31 PM, Torben Knerr < " target="_blank"> > wrote:
Hi Doug,

chef-sugar should be able to sweeten that up for you (along with some
other useful stuff):
https://github.com/sethvargo/chef-sugar/

HTH,
Torben


On Fri, Feb 6, 2015 at 9:56 PM, Douglas Garstang
< "> > wrote:
> I was wondering if there was a way in attributes.rb, possibly with use of
> 'when' to determine if the environment was ec2 or vagrant? I'd like to know
> that before setting certain attributes.
>
> Doug
>
>




Archive powered by MHonArc 2.6.16.

§