[chef] Re: Re: Re: ec2 attributes


Chronological Thread 
  • From: José Guilherme Vanz < >
  • To:
  • Subject: [chef] Re: Re: Re: ec2 attributes
  • Date: Thu, 16 Apr 2015 19:23:12 +0000

I cannot use knife ec2. The instance is started by my auto scaling group.
Anyway, the instructions sent by Peter solved my problem

Thank you

On Thu, Apr 16, 2015 at 12:16 PM Yoshi Spendiff < " target="_blank"> > wrote:
It's worth knowing that if you use knife ec2 to create instances then it makes the hint file for you, which is possibly why you never knew about it.

On Thu, Apr 16, 2015 at 5:27 AM, Peter Burkholder < " target="_blank"> > wrote:
The node needs a 'hint' that it's in EC2. Namely this:

  mkdir -p /etc/chef/ohai/hints
  touch /etc/chef/ohai/hints/ec2.json

then run chef-client and ohai will find all ec2 facts.

--Peter

On Thu, Apr 16, 2015 at 7:09 AM, José Guilherme Vanz < " target="_blank"> > wrote:
Hi

I'm configuring an AWS auto scaling group in my infrastructure. Now, I am writing a script to install and configure chef-client in the ec2 instances launched automatically.

When I run the chef-client first time, it find my recipes and try to run them. Some of the recipes uses attributes from ec2 (e.g. node['ec2']['instance_id'] ). But this attribute does not exist in the instance. Some guy s in the irc channel told me to rerun ohai to reload the attributes. For this, I added the following code in the recipe:

https://gist.github.com/jvanz/d8b73de8a0d4457e11e7

But the problem persists. Is This what I should do?



--

Peter Burkholder — Customer Success Engineer

Unavailability: No travel/PTO in April

301-204-5767 –  " target="_blank">  – my: Linkedin  Twitter  Calendar

CHEF

CHEF.IO

TM

chef.io   Blog   Facebook   Twitter   Youtube  





--
Yoshi Spendiff
Ops Engineer
Indochino
Mobile: +1 778 952 2025



Archive powered by MHonArc 2.6.16.

§