joshmccall221 / dotvagrant

You put the lime in the coconut and shake it all up!
4 stars 2 forks source link

Selective Package Install? #10

Open cgideon opened 9 years ago

cgideon commented 9 years ago

Would it be possible to provide a way for the user to selectively choose which packages they want to install without modifying the provisioner? i.e. I want Java, TMux and ZSH but not anything else? Or I want Node and all the NPM managed packages but not Java?

Thoughts?

cgideon commented 9 years ago

While it's not about selective package install, there is a command that we can run to provision with different provisioners. Use --provision-with x where x is the provisioner.

i.e. vagrant provision --provision-with shell

Documentation can be found here: http://docs.vagrantup.com/v2/cli/provision.html http://docs.vagrantup.com/v2/provisioning/basic_usage.html

joshmccall221 commented 9 years ago

Check this out: http://www.linuxjournal.com/article/2807

There is a couple ways we can do this:

  1. Dependance on having dialog installed on host machine (easy enough for *nix but those windows users....):
  2. bash script runs after clone which sets on/off flags for packages or sets of packages before vagrant up
  3. Less dependancies : Vagrant up and on the first log in be prompted with a dialog to install packages (note, most likely will require reboot) <==== this is probably the most newbie friendly
  4. As @cgideon mentioned a vagrant up could give you default box and then you could provision with --provision-with x,y,z <==== I like this one as its probably the most familiar to vagrant users as it leverages vagrant functionality.

Thoughts?

cgideon commented 9 years ago

I like the --provision-with as well, but in order to do that I think you have to have multiple different provisioner files, which can be rather cludgy unless you can chain them together. Feel free to correct me if I'm wrong though.

I like option 2 the best, though that still requires modifying a file instead of asking for user input which is possibly the better route to go.

joshmccall221 commented 9 years ago

I looks like --provison-with x,y, would run scripts x,y and z like: --provision-with Joshscript,coryscript,jims

option 2 can prompt the user for input or just take arguments, no modifying of files.