[chef] Re: kitchen mulitple chef runs


Chronological Thread 
  • From: Adam Leff < >
  • To: chef < >
  • Subject: [chef] Re: kitchen mulitple chef runs
  • Date: Sat, 21 Mar 2015 13:05:15 +0000

I always forget that .kitchen.yml is passed through ERb, so this may be even easier. In your .kitchen.yml:

attributes:
<% if ENV['UPGRADE'] == 'true' %>
do_upgrade: true
<% else %>
do_upgrade: false
<% end %>

... and then run kitchen twice but changing your environ meant variable:

kitchen verify
export UPGRADE=true
kitchen converge && kitchen verify

Disclaimer: haven't tried it yet, but peeking at the code leads me to believe this should work!

Adam

On Fri, Mar 20, 2015 at 21:41 Adam Leff < "> > wrote:
It's a wee-bit hackish, but I've used .kitchen.local.yml for this purpose, populating it with the override stuff, naming it something different, and then moving it into place when needed.

- run kitchen verify
- mv kitchen-phase2 .kitchen.local.yml
- run kitchen converge && kitchen verify
- mv .kitchen.local.yml kitchen-phase2

Okay.... not "wee-bit hackish," it's ugly as sin :) But it may help you out.

Adam

On Fri, Mar 20, 2015 at 21:35 Bill Warner < " target="_blank"> > wrote:
Is it possible to have kitchen run chef on a new machine twice with different node attributes?

My primary goal is to test an upgrade feature of a cookbook.   do one run with the old version then do another run with a new version.

If it is possible my google skills have failed me and I need some assistance in finding it.


--
--
Bill Warner



Archive powered by MHonArc 2.6.16.

§