# Kitchen mulitple chef runs

**URL:** <https://discourse.chef.io/t/kitchen-mulitple-chef-runs/6440>\
**Category:** Chef Infra (archive)\
**Created:** [March 21, 2015, 1:34am UTC](https://discourse.chef.io/t/kitchen-mulitple-chef-runs/6440 "2015-03-21T01:34:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill\_Warner](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bill_warner/32/973_2.png) [@Bill\_Warner](https://discourse.chef.io/u/Bill_Warner)\
**Post date:** [March 21, 2015, 1:34am UTC](https://discourse.chef.io/t/kitchen-mulitple-chef-runs/6440/1 "2015-03-21T01:34:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![adamleff](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/adamleff/32/1097_2.png) [@adamleff](https://discourse.chef.io/u/adamleff)\
**Post date:** [March 21, 2015, 1:41am UTC](https://discourse.chef.io/t/kitchen-mulitple-chef-runs/6440/2 "2015-03-21T01:41:27Z")

</div>

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 [bill.warner@gmail.com](mailto:bill.warner@gmail.com) 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

---

<div class="post-metadata">

**Author:** ![adamleff](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/adamleff/32/1097_2.png) [@adamleff](https://discourse.chef.io/u/adamleff)\
**Post date:** [March 21, 2015, 1:05pm UTC](https://discourse.chef.io/t/kitchen-mulitple-chef-runs/6440/3 "2015-03-21T13:05:15Z")

</div>

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 [adam@leff.co](mailto:adam@leff.co) 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 [bill.warner@gmail.com](mailto:bill.warner@gmail.com) 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

---

<div class="post-metadata">

**Author:** ![someara](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@someara](https://discourse.chef.io/u/someara)\
**Post date:** [March 21, 2015, 4:16pm UTC](https://discourse.chef.io/t/kitchen-mulitple-chef-runs/6440/4 "2015-03-21T16:16:29Z")

</div>

There's also an ENV variable you can set to point at different .yml files

export KITCHEN\_YAML=.kitchen.seq-1.yml ; kitchen converge ; kitchen verify  
export KITCHEN\_YAML=.kitchen.seq-2.yml ; kitchen converge ; kitchen verify  
export KITCHEN\_YAML=.kitchen.seq-3.yml ; kitchen converge ; kitchen verify

-s

On Sat, Mar 21, 2015 at 9:05 AM, Adam Leff [adam@leff.co](mailto:adam@leff.co) wrote:

> 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 [adam@leff.co](mailto:adam@leff.co) 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 [bill.warner@gmail.com](mailto:bill.warner@gmail.com) 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

---

<div class="post-metadata">

**Author:** ![Bill\_Warner](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bill_warner/32/973_2.png) [@Bill\_Warner](https://discourse.chef.io/u/Bill_Warner)\
**Post date:** [March 21, 2015, 4:39pm UTC](https://discourse.chef.io/t/kitchen-mulitple-chef-runs/6440/5 "2015-03-21T16:39:21Z")

</div>

I'll give these a try and see what ends up working the best. Thanks all.

On Sat, Mar 21, 2015 at 9:16 AM, Sean OMeara [someara@chef.io](mailto:someara@chef.io) wrote:

> There's also an ENV variable you can set to point at different .yml files
> 
> export KITCHEN\_YAML=.kitchen.seq-1.yml ; kitchen converge ; kitchen verify  
> export KITCHEN\_YAML=.kitchen.seq-2.yml ; kitchen converge ; kitchen verify  
> export KITCHEN\_YAML=.kitchen.seq-3.yml ; kitchen converge ; kitchen verify
> 
> -s
> 
> On Sat, Mar 21, 2015 at 9:05 AM, Adam Leff [adam@leff.co](mailto:adam@leff.co) wrote:
> 
> > 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 [adam@leff.co](mailto:adam@leff.co) 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 [bill.warner@gmail.com](mailto:bill.warner@gmail.com)  
> > > 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

## --

Bill Warner
