You're going to need a server.
You will need an account with Amazon Web Services, and another with Cloudflare.
Install:
- An SSH client.
- If you're on macOS or Linux, you have one built in.
- On Windows 10, you can install Bash on Windows.
- On any other version of Windows, download and install PuTTY.
- An SSH key specifically for the job.
- If you're running on macOS, Linux, or Bash on Windows, run
ssh-keygen
and store the key at ~/.ssh/webops. (You may need to replace "~" with the absolute path to your home directory.) - If you're using PuTTY, run puttygen.exe and name the key "webops".
- If you're running on macOS, Linux, or Bash on Windows, run
- Terraform.
- Ansible.
- mosh (if available for your platform), which is like SSH (and uses it to bootstrap itself) but can handle flaky connections much more gracefully.
Then clone this repository. All local commands are expected to be run from the root of this repository unless specified otherwise.
This uses Amazon Web Services. If you'd rather use another cloud provider, you'll need to configure it yourself.
- If you haven't already, create an account on Amazon Web Services.
- Pick your favourite AWS region, grab your VPC ID and subnet ID, and create a file called terraform/terraform.tfvars as follows (you can copy *terraform/terraform.tfvars.example):
region = "<Region>" vpc_id = "<VPC ID>" subnet_id = "<Subnet ID>"
- If you're creating instances for lots of people, add a line to terraform/terraform.tfvars with the number:
count = <number of instances>
- Copy ansible/group_vars/all/variables.example to ansiblansible/group_vars/all/variables, and replace the values with your own. (You can leave the top two.)
cd
into the terraform directory.- Run
terraform init
to set it up. - Run
terraform plan
, then check the plan. - If you're happy, run
terraform apply
. This will create two servers. cd ..
back into the root directory.
If you want to do blue-green deployment, you need a hostname. You can probably simulate it by changing the local hosts file, but that's no fun.
- For security reasons, you'll probably want to create a fake Cloudflare account with access to a cheap domain, and use the token for that.
- Grab your Cloudflare token.
- Copy ansible/group_vars/all/variables.example to ansible/group_vars/all/variables, and replace the values with your own. (You can leave the top two.)
- Pick a subdomain (or a sub-subdomain) for each person/group. You'll need to distribute them as part of the Ansible configuration. Pick one for yourself too.
- Configure Pingdom to tell you whether it's up.
- Just before the workshop, turn Cloudflare's development mode on (it's on the Caching page). Otherwise it'll cache client CSS and break the demo.
If you're using our example application, Predestination, you'll need a bunch of dependencies. (And if you're not, they can't hurt.)
- Verify that ansible/inventory has been created with the IP addresses of your servers.
- Prime Ansible, either by installing
direnv
, or by manually including the .envrc file.source .envrc
- Tell Ansible to install everything:
ansible-playbook ansible/prerequisites.yaml
I'd recommend Predestination, but either way, make sure you own the repository. You'll make changes to it later.