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:
- my custom box called
dkarlovi/centos-6.6
- it gets embedded custom
vagrantfile
, https://github.com/dkarlovi/vagrant-playground/blob/master/box/_vagrantfile - when installed, file ends in
/home/dkarlovi/.vagrant.d/boxes/dkarlovi-vagrantslash-centos-6.6/1.0.0/virtualbox/include/_vagrantfile
- i create new vagrant project in
/home/dkarlovi/vagrant/project1
,vagrant init dkarlovi/centos-6.6 --minimal
- 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'svagrantfile
started all - 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
Post a Comment