w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Running script automatically in vagrant

You can use inline script in Vagrantfile, even Here Document which made complex shell scripts embedded in it possible.

Example:

$script = <<'EOF'
echo shell provisioning...
date -R > /etc/vagrant_provisioned_at
EOF

Vagrant.configure("2") do |config|
  config.vm.provision :shell, :inline => $script
end

NOTE: single quoted LimitString is to escape special characters like or$`.

Check the Docs out => http://docs.vagrantup.com/v2/provisioning/shell.html





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.