Automate Server Setup with Ansible

Turn a manual server setup into a playbook that builds identical servers every time.

+120

POINTS

What you will build

A repeatable setup you can run against one server or fifty.

Starting point: you only need a Vultr account. This challenge is self-contained, so you can do it without having done any other.

The plan

  1. Deploy two fresh Ubuntu instances with your SSH key
  2. Create an inventory file listing both
  3. Write a playbook that installs Nginx, creates a user and deploys a page from a template
  4. Add a handler that restarts Nginx only when the config changes
  5. Run it once and then again; the second run should change nothing
  6. Add a third instance to the inventory and configure it with one command
BASH
ansible-playbook -i inventory.ini site.yml
ansible-playbook -i inventory.ini site.yml --check --diff

How you will be judged

  • Second run reports zero changes
  • Variables and templates instead of copy-pasted values
  • No passwords or keys in the repository

Destroy everything you created when you are done so you are not billed for it.

Requirements

Playbook configures two servers

Idempotent on a second run

Template and handler used

Third server added with one command

Resources

Submit Your Build

Challenge Questions

No questions about this Challenge yet
Ask anything about this Challenge prep, agenda or joining.