I need to have two project. One is to set up the server. The other is the web app. I'm trying to use SaltStack to do this via Vagrant. What I want to happen is that after the server is provisioned, I want to be able to call to the folder where the web app project lives and look for a salt stack and start a new provisioning. I maybe off on the logo here, but the short of it is right now I can make the server. That only way to get the app in there is to pollute the server salt folders with .sls
and pillars and such with the app's. I need to do something more like,
Vagrant.configure("2") do |config|
#sample vagrant salt
config.vm.synced_folder "provision/salt", "/srv/salt"
config.vm.provision :salt do |salt|
salt.bootstrap_script = 'provision/bootstrap_salt.sh'
salt.install_type = install_type
salt.verbose = verbose_output
salt.minion_config = "provision/salt/minions/vag.conf"
salt.run_highstate = true
end
end
which would run normal, but then at the last .sls
, lets call it final.sls
, we make a call out to a folder that is containing the app and the salt stack that would deploy it's state. Something like:
|-/www - the www host folder that comes with this project
| |-/{project name} - the project folder
| |--/html - | the web root for this project
| |--/provision - | the provisioner folder for the project to run after the server base
| |--/salt - | the salt provisioner
| |--/minions - | salt minions folder
| |--/pillar - | salt pillar folder
| |--top.sls - | salt top file that sets things in line
| |--/stage - | staging folder for installers
Which that would be a PROJECT
that is in the www folder of the server project that looks like
|-/server_base - the server base
| |--/provision - | the provisioner folder for the server base
| |--/salt - | the salt provisioner
| |--/minions - | salt minions folder
| |--/pillar - | salt pillar folder
| |--top.sls - | salt top file that sets things in line
| |--/www - | www folder that holds the project shown above
What I would think I would do is call maybe ?highstate
? as a cwd.run
from the last .sls
that the top.sls
defines. So right before the end of the salt provisioning, it starts a sub provisioning from the www/{project}
folder.