6.1 Starting at the End

Setup to Follow Along

If you have not done so already, setup according to §1.3.1 and, if you need to archive any current class files §1.3.2.1.

1cd sfs

On Mac/Linux:

1cp -r course-material/sfsP2020cp010 classroom

On Windows:

1xcopy course-material\sfsP2020cp010 classroom /E

All Platforms:

1cd classroom 
2vagrant up

Once your classroom VM is available connect using SSH.

1vagrant ssh

This VM is preloaded with a Salt configuration to build this server into a simple web server consisting of nginx serving a simple static website form /var/www/html.

Run Salt locally on this server using:

1sudo salt-call state.highstate

This command will take a while to run, during which nothing will appear to happen. On completion you will see results dumped to the screen.

On your host computer, open a web browser and visit http://localhost:35555. You will see a simple web site being served from the VM.

6.1.1 What did we just do?

When the VM was set up several things were preconfigured (if you’re curious—and you should be—check out sfs/classroom/provisioning/build on your host computer1).

  • Some tools required for the setup scripts were installed.
  • salt was installed using the bootstrap script we used in Chapter 5.1.
  • Some salt configuration files where put in place.
  • A set of files describing the configuration we want on our machine where copied from a Git repository.
  • The website files where put in place.

You then logged into this prepared machine and used salt-call to instruct Salt to ensure that the machine was configured according to the specification copied during VM setup.

We will now spend the next few chapters learning how to set this up from scratch and in doing this we will learn a lot of the core ideas behind Salt’s configuration management functionality.

1If you are not confident reading Bash scripts check out Programming from Scratch[Boo22].