[chef] Re: ec2 attributes


Chronological Thread 
  • From: Peter Burkholder < >
  • To: " " < >
  • Subject: [chef] Re: ec2 attributes
  • Date: Thu, 16 Apr 2015 08:27:22 -0400

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  





Archive powered by MHonArc 2.6.16.

§