2.5 KiB

Sysadmin Interview Exercises

Step 1 - Deploy Webserver

I was able to provision a new virtual machine on my Proxmox hypervisor and install the requisite software for this task. I chose to install Debian, as I have experience with it and it is well-suited for tasks such as these.

While I do have an existing Docker host VM, I decided to create a new one in order to fully document the process here and ensure that it was fresh in my mind.

Once it was running, I installed Docker, cloned the given repository, and built the Docker image. I then started it with a shell in order to explore the container.

The web app is a simple Django app with a single URL defined which simply renders the index.html template. It has the admin app installed, but it doesn't actually seem functional.

Once I had determined this, I wrote a simple Ansible playbook to deploy the container from scratch, including installing dependencies, pulling the latest Dockerfile, and building the container. I also added an entry to my Nginx configuration (at https://sysadmin-exercise.internal.ezri.dev/, accessible from the ITS building or USU VPN), as I consider HTTPS access to be a part of deploying a webapp unless told otherwise. I then visited the above site from my browser.

Tasks

  1. Create virtual machine in Proxmox hypervisor
  2. Install Debian
  3. Log into system, install Docker
  4. Clone repository
  5. Build container
  6. Run container with shell to explore filesystem
  7. Create Ansible role and playbook to deploy the container
  8. Add web entry to Nginx Ansible group variables
  9. Run ansible playbooks
  10. Visit website

Step 2 - Complete Additional Exercises

I completed three of these exersises (two Linux, one Python) and was honestly having fun with them so I decided to do all of the Linux and Python ones.

Linux Exercises

Python Exercises

As most of my experience with Python is in programming and scripting, I wrote these solutions as executable Python files. However, they are all short and simple enough that they can be executed from a REPL (such as ipython) without issue, and in fact this is mostly how I was testing them.