Vagrant/EC2 in attributes


#1

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


#2

Hi Doug,

chef-sugar should be able to sweeten that up for you (along with some
other useful stuff):

HTH,
Torben

On Fri, Feb 6, 2015 at 9:56 PM, Douglas Garstang
doug.garstang@gmail.com 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


#3

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 mail@tknerr.de 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
doug.garstang@gmail.com 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


#4

Thanks. Wasn’t aware of that.

On Fri, Feb 6, 2015 at 1:31 PM, Torben Knerr mail@tknerr.de 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
doug.garstang@gmail.com 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


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#5

Actually, node[:virtualization][:system] has been working well too.

On Mon, Feb 9, 2015 at 9:09 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

Thanks. Wasn’t aware of that.

On Fri, Feb 6, 2015 at 1:31 PM, Torben Knerr mail@tknerr.de 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
doug.garstang@gmail.com 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


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627