Thanks for sharing. Its a nifty solution. In my case, I have things
I want to do outside the VMs to prepare for each converge. I want to
package up some files to be placed into the the data_path. I am not sure
how to handle that in vagrantfile.
----- Original message -----
From: Torben Knerr firstname.lastname@example.org
Cc: "email@example.com" firstname.lastname@example.org
Subject: [chef] Re: Re: Re: Re: Re: Re: Tips for running a script before
Date: Wed, Sep 30, 2015 1:11 PM
I had a similar issue and came to this solution:
In my case I have the whole ~/ directory under control, and I wanted it
to apply globally rather than repreating in every project kitchen /
Vagrantfile. Should work for local ones too
Just for inspiration…
On Wed, Sep 30, 2015 at 5:14 PM, Yoshi Spendiff email@example.com
Looks like it’s in the works:
You might have to use regular Vagrant for now as that supports multiple
provisioners (i.e. run the shell provisioner before Chef)
On 29 September 2015 at 20:18, Brian O’Connell firstname.lastname@example.org wrote:
I am struggling with a similar scenario. As part of our chefdk
bootstrap, we package up a set of cookbooks using berks package. We have
a a curl bash that end users execute to install/update the dev environment.
We have been testing using test kitchen w/ the chef provisioner but
because the testing doesn’t fully simulate our real environment (chef may
or may not be installed, bash script to start the process not run) we have
had a couple of defects escape testing.
The pre_create_command doesn’t work because we want these set of
commands to be run before every converge, not just the first create.
I have considered using the vagrantfiles directive with a custom vagrant
file, but its not clear to me that would help since that only seems to get
executed on create as well.
I could create a script that does this, but that i somewhat unsatisfying
because it fights against the muscle memory for all of our other cookbooks.
Has anyone come across a good solution to resolve this in test kitchen?
It feels like a pre_converge_command would be optimal for this sort of
----- Original message -----
From: Robert Freiberger email@example.com
To: "firstname.lastname@example.org" email@example.com
Subject: [chef] Re: Re: Re: Tips for running a script before kitchen
Date: Tue, Sep 29, 2015 5:46 PM
Thanks Brandon and Steve for your recommendations. Apologies as I was
away but I’m testing these features now. My original goal was to edit a
Vagrant box and make some changes (just add a Ruby script to execute during
start up) but after reading, might be easier to keep this separate.
On Fri, Sep 18, 2015 at 6:42 PM Steve Murawski <
You can tell vagrant to use it’s shell provisioner, but you’d likely
need to provide a custom vagrantfile.erb (there’s a parameter for that in
the kitchen-vagrant driver).
The pre_create_command happens before the vagrant up, so that’d be
something more for prepping your host environment (maybe staging sync’d
folders or something).
On Fri, Sep 18, 2015 at 4:44 AM, Brandon Raabe firstname.lastname@example.org
I’m not sure what’s in the script, but the
may be what you’re looking for. I’m assuming you’re using kitchen-vagrant.
On Thu, Sep 17, 2015 at 2:53 PM, Robert Freiberger <
I’m working on a simple Vagrant box with Test Kitchen and pretty sure
this is a simple request. Is it possible to execute a script before kitchen
converge? Maybe I’m not seeing this, but I checked the options from Test
I really would like to stay away from customizing the box file if
Community Software Development Engineer @ Chef
Microsoft MVP - PowerShell