provisioning - Running script automatically in vagrant -
how can run script automatically when vagrant up? used provision method. in method need point out .sh
file. dont want point .sh
file. need build script within vagrantfile
. please me fix issue.
i tried
vagrant::config.run |config| config.vm.provision :shell, :path => "test.sh end
i want append scripts in test.sh
vagrant file directly.
you can use inline script in vagrantfile
, here document made complex shell scripts embedded in possible.
example:
$script = <<'eof' echo shell provisioning... date -r > /etc/vagrant_provisioned_at eof vagrant.configure("2") |config| config.vm.provision :shell, :inline => $script end
note: single quoted limitstring escape special characters or
$`.
check docs out => http://docs.vagrantup.com/v2/provisioning/shell.html
Comments
Post a Comment