Comments (27)
It would be nice to re-add vagrant-cachier or some other things to this through this method.
from kitchen-vagrant.
+1
from kitchen-vagrant.
@fnichol Does this sound like a feature that you would be willing to merge in to master?
from kitchen-vagrant.
I would appreciate this feature for reasons stated in #100.
from kitchen-vagrant.
@colindean @nelsonjchen same issue here - also wanted to add vagrant-cachier. Got it successfully added via the global ~/.vagrant.d/Vagrantfile
config, but it does not kick in for caching the omnibus installer yet, see test-kitchen/test-kitchen#440
I played around with creating my own Vagrantfile.erb
, but that is doomed to fail once kitchen-vagrant makes changes to the default Vagrantfile.erb it ships with...
I'm 👍 for the possibility to append to the default Vagrantfile rather than copy / pasting the whole file (and all the future problems that this approach brings with)
from kitchen-vagrant.
👍
from kitchen-vagrant.
For those interested, I have started working on a solution which I hope strikes a balance between being simple and extensible. I'll push the branch up soon.
from kitchen-vagrant.
@byggztryng cool stuff, let us know when there is something we can test
from kitchen-vagrant.
@fnichol @sethvargo is there any kind of vetted way that I could test my PR?
from kitchen-vagrant.
#111 is what I'm thinking. More robust symbol detection and replacement logic is needed, though, because Test Kitchen uses SafeYaml to load .kitchen.yml with the option to not deserialize any symbols.
from kitchen-vagrant.
I did some research on this today. Could we leverage Vagrantfile merging and load order instead of appending? It seems like a more extensible solution. Then, instead of having this in your .kitchen.yml, you would have a real Vagrantfile that is merged with that of Kitchen
from kitchen-vagrant.
@sethvargo looks like it, so long as people are willing to package their own boxes with customized Vagrantfiles.
from kitchen-vagrant.
@byggztryng why boxes? You could package it with a cookbook and you only need a partial vagrantfile, which seems to be what is requested here.
from kitchen-vagrant.
@sethvargo the documentation seems to suggest that the hooks for merging are strictly defined, but I think that packaging a Vagrantfile with a cookbook would require the ability to refer to it in addition to the Vagrantfile generated by kitchen-vagrant, which is sourced at level 3. Is that possible?
from kitchen-vagrant.
You can change the starting directory where Vagrant looks for a Vagrantfile by setting the VAGRANT_CWD environmental variable to some other path.
from kitchen-vagrant.
Right, but I think that's still just for determining the sole Vagrantfile for level 3. Note that the lookup path logic states that it stops at the first Vagrantfile found, which I think would then block the kitchen-vagrant file.
from kitchen-vagrant.
@mitchellh what would be a good pattern to follow here?
from kitchen-vagrant.
@sethvargo The best option would be to somehow require
the Vagrantfiles from the source Vagrantfile (in VAGRANT_CWD
). The merge logic will invoke.
from kitchen-vagrant.
Okay. So the .kitchen/MACHINE/Vagrantfile
could have something like:
require_relative '../../Vagrantfile' if File.exist?(File.expand_path('../../Vagrantfile', __FILE__))
from kitchen-vagrant.
Yep no problem. You might want to put that at the end if you want that contents to merge AFTER the Vagrant.configure
in the Kitchen Vagrantfile.
from kitchen-vagrant.
Awesome thanks!
from kitchen-vagrant.
@sethvargo @byggztryng +1 for using Vagrantfile merging + load order.
The name of the Vagrantfile should be configurable though instead of assuming "../../Vagrantfile"
(which might be used for something else).
Or default to something more explicit like "../../.kitchen.Vagrantfile"
?
from kitchen-vagrant.
@tknerr I think that entire path could probably be exposed to .kitchen.yml, so that the Vagrantfile could be included in the cookbook files, as suggested by @sethvargo.
@sethvargo, I'll take this advice and create a new PR.
from kitchen-vagrant.
#112 uses the Vagrantfile merging
from kitchen-vagrant.
@byggztryng do you still need this now that we have user Vagrantfiles?
from kitchen-vagrant.
@sethvargo personally, no; I've moved on to using docker.
from kitchen-vagrant.
Cool, thanks!
from kitchen-vagrant.
Related Issues (20)
- hyper-v error HOT 3
- kitchen converage error HOT 1
- Kitchen converge fails on Windows 10 syncing initial cookbooks HOT 1
- <VagrantPlugins::RDP::Config:0x00000001039ce8f8> (NoMethodError) HOT 4
- Specifying custom SSH port does not work HOT 1
- Provide a way to change the main disk's size HOT 1
- SMB File Shares are hanging HOT 1
- kitchen create error(s) - hyper-v win server 2016 guest HOT 2
- Add qemuargs to libvirt section HOT 2
- Windows WSL with Hyper-V fails HOT 1
- box_auto_prune: true - do not cause an error when an older box is still actively in use on the machine, just wait until the next run to try again HOT 1
- box_auto_update -- produces an error when no box exists already to check for an update against HOT 2
- Consider always warning when a new box is available
- kitchen adds carriage return to shebang on bootstrap.sh when converging effortless package HOT 1
- SSH Config not sufficient in WSL2 HOT 4
- Unable to configure network with Vagrant/VirtualBox HOT 7
- Unable to configure network with Vagrant/VirtualBox HOT 3
- `network': wrong number of arguments (given 2, expected 1) (ArgumentError) HOT 1
- RSA key no longer accepted by OpenSSH 8.8+ HOT 1
- AWS credentials not passing through to Vagrant box HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitchen-vagrant.