Ok that error went away after i upgraded Vagrant to latest version 1.8.1
Although i still don't see the env var getting set inside the vagrant VM

$ vagrant provision==> default: Running provisioner: shell...
    default: Running: inline script
==> default: stdin: is not a tty
==> default: var HOST_IP=10.2.2.70
==> default: Running provisioner: shell...
    default: Running: 
/var/folders/5m/48h7dsrx39x2vl_xqmlddtch0000gn/T/vagrant-shell20160407-5063-rurl2r.sh
==> default: stdin: is not a tty
==> default: HOST_IP=10.2.2.70
==> default: $1=arg1
-----------------------------------------
$ vagrant ssh
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-85-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Thu Apr  7 20:45:34 UTC 2016

  System load:  0.0               Users logged in:        0
  Usage of /:   5.8% of 39.34GB   IP address for eth0:    10.0.2.15
  Memory usage: 33%               IP address for eth1:    10.2.2.70
  Swap usage:   0%                IP address for docker0: 172.17.0.1
  Processes:    84

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

120 packages can be updated.
57 updates are security updates.


Last login: Thu Apr  7 20:47:07 2016 from 10.0.2.2
*vagrant@vagrant-ubuntu-trusty-64:~$ echo $HOST_IP*

vagrant@vagrant-ubuntu-trusty-64:~$ sudo su
root@vagrant-ubuntu-trusty-64:/home/vagrant#
--------------------------------------
$ cat provision.sh
#!/bin/bash

if [ ${HOST_IP} ]; then
echo "HOST_IP=${HOST_IP}"
        *export HOST_IP=${HOST_IP}*
else
echo "var HOST_IP not set"
fi

if [ ${1} ]; then
echo "\$1=${1}"
fi

On Thursday, April 7, 2016 at 1:10:23 PM UTC-7, Alvaro Miranda Aguilera 
wrote:
>
> it should work without any plugin.
>
> Whats the output of
>
> vagrant version
> vagrant plugin list
>
>
>
> On Fri, Apr 8, 2016 at 8:06 AM, Kunal Pariani <[email protected] 
> <javascript:>> wrote:
>
>> I see the following error while trying this
>> There are errors in the configuration of this machine. Please fix
>> the following errors and try again:
>>
>> shell provisioner:
>> * The following settings shouldn't exist: env
>>
>> Do i need something additional here ? I installed the vagrant-env plugin 
>> too but that didn't work either
>>
>> Thanks
>>
>> On Wed, Apr 6, 2016 at 9:35 PM, Alvaro Miranda Aguilera <[email protected] 
>> <javascript:>> wrote:
>>
>>> Doh the link:
>>>
>>> gist
>>>
>>> https://gist.github.com/kikitux/89cc71db3fae8ba28eb8de720274db1c
>>>
>>>
>>>
>>> ^ gist
>>>
>>>
>>>
>>> On 7/04/2016, at 4:29 PM, Alvaro Miranda Aguilera <[email protected] 
>>> <javascript:>> wrote:
>>>
>>> hello,
>>>
>>> have a look at this.
>>>
>>> Please let me know if helps, or its something missed.
>>>
>>> Thanks
>>> Alvaro.
>>>
>>> On Thu, Apr 7, 2016 at 11:53 AM, Kunal Pariani <[email protected] 
>>> <javascript:>> wrote:
>>>
>>>> I need to do copy over an env var from the host (my Mac) to the vagrant 
>>>> VM. Any ideas on how to do this ? I tried couple of options after googling 
>>>> but none seem to work.
>>>> Most notably this one didn't work either: 
>>>> http://stackoverflow.com/questions/22578983/setting-env-vars-from-host-to-guest-in-vagrant
>>>>
>>>> -- 
>>>> This mailing list is governed under the HashiCorp Community Guidelines 
>>>> - https://www.hashicorp.com/community-guidelines.html. Behavior in 
>>>> violation of those guidelines may result in your removal from this mailing 
>>>> list.
>>>>  
>>>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>>>> IRC: #vagrant on Freenode
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Vagrant" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected] <javascript:>.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/vagrant-up/4192f836-9d55-49d3-84eb-96fe629cddaf%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/vagrant-up/4192f836-9d55-49d3-84eb-96fe629cddaf%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>> -- 
>>> This mailing list is governed under the HashiCorp Community Guidelines - 
>>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>>> violation of those guidelines may result in your removal from this mailing 
>>> list.
>>>  
>>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>>> IRC: #vagrant on Freenode
>>> --- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Vagrant" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/vagrant-up/4PqYtQvTHqU/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> [email protected] <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/vagrant-up/C4CDA613-D320-4538-B42B-80DED91EE558%40gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/vagrant-up/C4CDA613-D320-4538-B42B-80DED91EE558%40gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>> IRC: #vagrant on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Vagrant" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vagrant-up/CAE2U0gXMThrFiNM63ZbZ_Epjz2gAnHQEDW0dEaA1J1ryR14jig%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/vagrant-up/CAE2U0gXMThrFiNM63ZbZ_Epjz2gAnHQEDW0dEaA1J1ryR14jig%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/aec4cb01-ded2-4f94-8eda-c9390ceb3d23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to