The provisioning shell script is currently inline. This makes it impossible to run the script without invoking the Vagrant provisioning procedure, and is just wrong. Correct it at once.
Suggested Solution
Of course the variables from the Vagrantfile need to go into the script somehow. There are 3 known ways to do that:
Extract the configuration into a separate file, and read the values from there. Perhaps, just a script with VAR="value" statements that can be sourced.
This has the disadvantage of making the hostname inaccessible from the Vagrantfile, where it is necessary to configure the hostsupdater plugin. Same with path_apache_www, which is needed to mount the project directory in the VM.
In the Vagrantfile, use export commands in an inline script to assign "global" variables, then run the separate provisioning shell script.
Make the provisioning shell script accept arguments via parameters. In this case, there may be too many parameters, and it increases the script's complexity.
The Problem
The provisioning shell script is currently inline. This makes it impossible to run the script without invoking the Vagrant provisioning procedure, and is just wrong. Correct it at once.
Suggested Solution
Of course the variables from the
Vagrantfile
need to go into the script somehow. There are 3 known ways to do that:VAR="value"
statements that can be sourced. This has the disadvantage of making the hostname inaccessible from theVagrantfile
, where it is necessary to configure thehostsupdater
plugin. Same withpath_apache_www
, which is needed to mount the project directory in the VM.Vagrantfile
, useexport
commands in an inline script to assign "global" variables, then run the separate provisioning shell script.