Giter Site home page Giter Site logo

Comments (27)

nelsonjchen avatar nelsonjchen commented on June 14, 2024

It would be nice to re-add vagrant-cachier or some other things to this through this method.

from kitchen-vagrant.

ifeltsweet avatar ifeltsweet commented on June 14, 2024

+1

from kitchen-vagrant.

 avatar commented on June 14, 2024

@fnichol Does this sound like a feature that you would be willing to merge in to master?

from kitchen-vagrant.

colindean avatar colindean commented on June 14, 2024

I would appreciate this feature for reasons stated in #100.

from kitchen-vagrant.

tknerr avatar tknerr commented on June 14, 2024

@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.

docwhat avatar docwhat commented on June 14, 2024

👍

from kitchen-vagrant.

 avatar commented on June 14, 2024

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.

tknerr avatar tknerr commented on June 14, 2024

@byggztryng cool stuff, let us know when there is something we can test

from kitchen-vagrant.

 avatar commented on June 14, 2024

@fnichol @sethvargo is there any kind of vetted way that I could test my PR?

from kitchen-vagrant.

 avatar commented on June 14, 2024

#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.

sethvargo avatar sethvargo commented on June 14, 2024

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.

 avatar commented on June 14, 2024

@sethvargo looks like it, so long as people are willing to package their own boxes with customized Vagrantfiles.

from kitchen-vagrant.

sethvargo avatar sethvargo commented on June 14, 2024

@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.

 avatar commented on June 14, 2024

@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.

sethvargo avatar sethvargo commented on June 14, 2024

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.

 avatar commented on June 14, 2024

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.

sethvargo avatar sethvargo commented on June 14, 2024

@mitchellh what would be a good pattern to follow here?

from kitchen-vagrant.

mitchellh avatar mitchellh commented on June 14, 2024

@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.

sethvargo avatar sethvargo commented on June 14, 2024

Okay. So the .kitchen/MACHINE/Vagrantfile could have something like:

require_relative '../../Vagrantfile' if File.exist?(File.expand_path('../../Vagrantfile', __FILE__))

from kitchen-vagrant.

mitchellh avatar mitchellh commented on June 14, 2024

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.

sethvargo avatar sethvargo commented on June 14, 2024

Awesome thanks!

from kitchen-vagrant.

tknerr avatar tknerr commented on June 14, 2024

@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.

 avatar commented on June 14, 2024

@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.

 avatar commented on June 14, 2024

#112 uses the Vagrantfile merging

from kitchen-vagrant.

sethvargo avatar sethvargo commented on June 14, 2024

@byggztryng do you still need this now that we have user Vagrantfiles?

from kitchen-vagrant.

 avatar commented on June 14, 2024

@sethvargo personally, no; I've moved on to using docker.

from kitchen-vagrant.

sethvargo avatar sethvargo commented on June 14, 2024

Cool, thanks!

from kitchen-vagrant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.