> On Apr 9, 2015, at 4:13 PM, Alvaro Miranda Aguilera <
kik...@gmail.com> wrote:
>
> Hello There,
>
> Don't get frustrated and see what vagrant hast to offer.. it does help a lot.
>
> But, if Vagrant is a hammer (or used as a hammer) perhaps is not the
> best tool for everything
>
> you may test file/shell/puppet/chef/ansible...
>
True, but solving problems by adding complexity rarely works on the long run.
Puppet/chef/ansible are all fine tools, but not ideal for the tiny scale I'm at. That's a lot like using a jet airplane to commute 50 miles.
> back to your point.. This has been discussed over and over and over,
> and you can search those in the groups or github
>
Searching didn't yield many results actually - so it's hard to gauge by the lack of hits that an idea has been discussed to death.
> but basically, your first shot should be always write your own plugin,
> or use a separate plugin, check what vagrant triggers has to offer, it
> may suit you
>
True - but again let's solve a problem by adding complexity? I've never authored a plugin for vagrant so I can't even begin to wonder how much time I'd spend figuring out how to wire up a plugin that just makes extra arguments from the command line accessible from the Vagrantfile.
> ENV is very cool way to have something portable,
> and look at this in
> this way.. you set a variable outside vagrant, and vagrant
> transparently pass the argument to a shell script.. magic..
And just like the NSA, any other process in the same subshell can see the "DickPic" stored in ENV too.
I won't deny that ENV works - but it's not all that's cracked up to be. You've obviously not done much IT administration on secured systems. ENV is good for static state, but will get you into trouble when used as a control feature. For example - bash isn't necessarily your friend with ENV - by default non-interactive shells often will not cascade exported ENV like interactive bash. Hence passing a value via ENV doesn't even work. Use of ENV also violates the idempotent nature of the Vagrantfile file, IMO, setting an ENV for one script, could unintentionally have side effects on another script. It's hard to create side effects like I describe if you could just pass an argument.
Another example that vagrant users might be familiar- SALTSTACK. ENV is static, as I recall, and cannot be modified during execution/parsing of the YAML - all to prevent Environment Variable induced side effects.
I can live with ENV, it solves my immediate problem. I just don't believe it's the optimal solution that should be available, and just kinda sad that there's no simple solution for custom command line args. I'm not complainining, I'm just pointing out that with all the awesomeness that Vagrant is - I'd love to see some feature consistency across commands that behave in similar ways which would make it a better offering for all. IMO, being able to pass arguments to a shell application that executes a script command line is a very common feature. I think 90% of people would expect that kind of behavior I describe by default and wouldn't expect to have to do magic tricks and a lot of work to get that to work.