Hello

This works,

note I did leave a leading space after the script, to have that space
between the script name and the argument

Vagrant.configure(2) do |config|
  config.vm.box = "hashicorp/precise64"
  $ip="10.141.141.10"
  config.vm.provision "shell", inline: "bash /vagrant/prepareMaster.sh " + $ip
end

another way of doing this is per the example:
https://docs.vagrantup.com/v2/provisioning/shell.html


Vagrant.configure(2) do |config|
  config.vm.box = "hashicorp/precise64"
  $ip="10.141.141.10"
  config.vm.provision "shell" do |s|
    s.inline = "bash /vagrant/prepareMaster.sh"
    s.args = $ip
  end
end

On Fri, Jul 31, 2015 at 4:11 PM, leon <[email protected]> wrote:
> I am trying to do something like below:
>
>   $ip="10.141.141.10"
>
>   config.vm.provision "shell", inline: <<-SHELL
>     /vagrant/prepareMaster.sh $ip
>   SHELL
>
> However, $ip is not passed in the script. I tried different things such as
> "$ip", [$ip], ["$ip"], '$ip'. None of solutions mentioned in
> http://docs.vagrantup.com/v2/provisioning/shell.html#inline-scripts works
> for me.
>
> Any idea? Thanks.
>
> --
> 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/b99fbfb1-fad2-444c-a25c-59c761d1e2ce%40googlegroups.com.
> 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/CAHqq0eyWWje45%3D7oxRdMEOezNrFT%2BE71wJWk%3DLnd563mB%3DbzSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to