Companion repository for my blog post series Infra as a Repo.
In its current incarnation, this example provisions two servers: one salt master (salt
) and one minion that will run
Nginx (nginx01
). These servers can be run locally on VirtualBox, or on Digital Ocean Droplets.
- Install Virtual Box
- Install Vagrant
- Install vagrant-hostmanager:
vagrant plugin install vagrant-hostmanager
- Install vagrant-digitalocean:
vagrant plugin install vagrant-digitalocean
- Install salty-vagrant as described below
If you want to deploy to Digital Ocean, you will need an account well.
The latest official vagrant-salt-plugin release is somewhat outdated. To use this example, you will need to take the following steps:
- Check out salty-vagrant
- Apply Pull Request #98
- Install the plugin following the "Install from source" instructions.
Run vagrant up
to create two virtualbox images. This will download a minimal Debian Wheezy 7.0 image from my
dropbox account and spin up two images:
salt
-- a VM containing nothing but a Salt masternginx01
-- a VM containing a Salt minion, which installs an Nginx server
If you want easy access to these machines, add the following lines to your /etc/hosts
file:
10.1.14.100 nginx01.intranet
10.1.14.50 salt.intranet
Copy the Vagrant.local.example
to ~/.vagrant.d/
and enter your Digital Ocean API key.
Run vagrant up --provider=digital_ocean
to provision both servers at Digital Ocean. Run vagrant rebuild
to
recreate these server.
By default, the servers are the cheapest Droplets, hosted in NYC.