ruby - Origin Vagrantfile location from box-embedded Vagrantfile -


i have custom box contains embedded vagrantfile (let's call vf1). file contains lot of box-specific config / functionality , target should (and am) able generate project vagrantfile (vf2) with:

vagrant.configure(2) |config|   config.vm.box = "my/box" end 

and still functionality (puppet integration, virtualbox tweaks, yaml config support, etc). problem i'd read files relative vf2 vf1. way see it, vf2 gets loaded before vf1 , thus, vagrant should able figure out vf2 before loading loading vf1. so, how access information?

now, me more concrete, i'll start linking gh repo can see i'm trying do: https://github.com/dkarlovi/vagrant-playground

so:

  1. my custom box called dkarlovi/centos-6.6
  2. it gets embedded custom vagrantfile, https://github.com/dkarlovi/vagrant-playground/blob/master/box/_vagrantfile
  3. when installed, file ends in /home/dkarlovi/.vagrant.d/boxes/dkarlovi-vagrantslash-centos-6.6/1.0.0/virtualbox/include/_vagrantfile
  4. i create new vagrant project in /home/dkarlovi/vagrant/project1, vagrant init dkarlovi/centos-6.6 --minimal
  5. when running, can see /home/dkarlovi/vagrant/project1/vagrantfile gets evaluated before /home/dkarlovi/.vagrant.d/boxes/dkarlovi-vagrantslash-centos-6.6/1.0.0/virtualbox/include/_vagrantfile should, in theory, able figure out where's vagrantfile started all
  6. i'm simulating this, see line 11 not work if run vagrant /home/dkarlovi/vagrant/project1/src

i'm doing of able check existence of files (puppet related) , turn provisioning on/off i'd able have full puppet stack (if files present) or nothing (if not present), box becomes more versatile , usable (for usages).


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -