Hi, 

I'm trying to work out the syntax for using a multiline variable with 
Vagrant triggers. 

Following the example here:

https://www.vagrantup.com/docs/provisioning/shell.html#inline-scripts

Looking at the example:

$script = <<-SCRIPT
> echo I am provisioning...
> date > /etc/vagrant_provisioned_atSCRIPT
> Vagrant.configure("2") do |config|
>   config.vm.provision "shell", inline: $scriptend
>
>
 This works great if I run 
config.vm.provision "shell", inline: $script

but say I want to run it like this:
        trigger.run_remote = inline: $script

I get the error: 
syntax error, unexpected ':', expecting keyword_end

EG:
   

>     $script = <<-SCRIPT       
>  
>
>   echo I am provisioning...
>   date > /etc/vagrant_provisioned_at
>
>     SCRIPT
>
>     machine.trigger.before :provision do |trigger|
>         trigger.run_remote = inline: $script
>     end
>

Anyone know the correct syntax for triggers?

-- 
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/ce818b86-ad5a-437b-bbd2-067d5f42be72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to