Let's get to the main part of this chapter: provisioning a Vagrant machine with Salt. We'll look at the masterless
configuration setup for this section. We'll learn how to install the Nginx web server onto our Vagrant machine:
- Create a new folder/directory for this example. I'm calling mine
vagrant-salt
. - Move into the new folder and run the
vagrant init -m
command to create a new Vagrantfile. - We need to create some folders and files for Salt. Create a
roots
folder and aminionfiles
folder. Inside theroots
folder, create a file calledtop.sls
and enter these contents:
base: '*': - base
Within the same folder (roots
), create another file called base.sls
and enter these contents:
nginx: pkg.installed: - name: nginx
The top file dictates what hosts to target. We can use the *
icon here to indicate that we will target all hosts. This is not always the best option, but in this instance it will work fine. It also dictates what Salt...