Hi,
I'm trying to work out the syntax for using a multiline variable with Vagrant triggers.
Following the example here:
Looking at the example:
$script = <<-SCRIPT
echo I am provisioning...
date > /etc/vagrant_provisioned_at
SCRIPT
Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: $script
end
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?