Hey there! You are missing brackets for the run_remote option. It is slightly different in that fact, but otherwise the options should be very close or the same. I recommend looking at the trigger documentation
https://www.vagrantup.com/docs/triggers/configuration.html#run_remote The usage docs also have examples of how to use them https://www.vagrantup.com/docs/triggers/usage.html Thanks! On Sun, Mar 24, 2019 at 9:05 PM Noah O'Donoghue <[email protected]> wrote: > 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 > <https://groups.google.com/d/msgid/vagrant-up/ce818b86-ad5a-437b-bbd2-067d5f42be72%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Brian Cain -- 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/CADHESCVDgcxxkmc7OukcWREOohfjzzEmHzD6GnfBLV8U7zOZ5A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
