[chef] Re: aws and chef do not play nice


Chronological Thread 
  • From: Morgan Blackthorne < >
  • To: " " < >
  • Subject: [chef] Re: aws and chef do not play nice
  • Date: Wed, 20 Nov 2013 20:24:26 -0800

Speaking of this, I noticed that private VPC nodes don't seem to have node['cloud'] or node['ec2'] defined. Is there a good workaround for this, to always force these attributes to get loaded on those nodes? I bake my own AMIs so if that helps, I'm fine with it.

On Wednesday, November 20, 2013, Julian C. Dunn wrote:
Part of the issue is that we have not yet found a reliable way in Ohai
to detect whether a machine is running in EC2. Hence the hints file.
However, creating the hints file in recipe code is not sufficient to
populate node['ec2'] because by that point, Ohai has already run.

You can create the hints file *before* you run Chef in a number of
ways, one of which is that "knife ec2 server create" will take a
--hint parameter.

- Julian

On Wed, Nov 20, 2013 at 2:49 AM, Jordan Dea-Mattson
< > wrote:
> The issue is, I believe, that at the time you execute this recipe that
> node['ec2']['instance_id'] is not defined. This is the cause of your failure
> due to 'undefined method'.
>
> This is a Ruby runtime exception and is not 'managed' by 'ignore_failure'.
>
> I previously encountered a similar issue. It was due to Ohai not setting the
> 'instance_id' appropriately on first run and was tied to a particular
> version of Ohai.  What version of Chef and version of Ohai are you using?
>
> The reason it executes successfully following your first run, is that Ohai
> is not properly setting the 'instance_id'.
>
> Yours,
>
> Jordan


--
[ Julian C. Dunn < >          * Sorry, I'm    ]
[ WWW: http://www.aquezada.com/staff/julian    * only Web 1.0  ]
[ gopher://sdf.org/1/users/keymaker/           * compliant!    ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9       ]


--
--
~*~ StormeRider ~*~

"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS




Archive powered by MHonArc 2.6.16.

§