*SOLUTION*: A lot of other people were asking this, and fortunately there's
a known solution out there:
In your Vagrantfile, you'd have something like this:
* config.vm.hostname = "name_of_some_server.dev" VAGRANT_JSON =
JSON.parse(Pathname(__FILE__).dirname.join('../../nodes',
"#{config.vm.hostname}.json").read)*
and later
config.vm.provision :chef_solo do |chef|
# Remove, Extract, Add Runlist
* chef.run_list = VAGRANT_JSON.delete('run_list') if
VAGRANT_JSON['run_list']*
# Add JSON Attributes
* chef.json = VAGRANT_JSON*
end
On Wednesday, June 24, 2015 at 12:18:22 PM UTC-7, Joaquin Menchaca wrote:
>
> I was wondering how to get this configured. I essentially would like to
> use a set of recipes and variables based on the host name.
>
> I am familiar with
>
> knife solo cook HOSTNAME
>
> And I would hope that a vagrant provision could use the
> nodes/hostname.json that can contain the "run_list" [ ... ]. I have been
> adding recipes in my Vagrantfile with chef.add_recipe as a workaround,
> but I would like it work through a vagrant provision.
>
> Ideas?
>
>
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/4fba46a9-6e20-4930-bac5-fe3fd2b5f516%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.