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
- Create virtual machine in Proxmox hypervisor
- Install Debian
- Log into system, install Docker
- Clone repository
- Build container
- Run container with shell to explore filesystem
- Create Ansible role and playbook to deploy the container
- Add web entry to Nginx Ansible group variables
- Run ansible playbooks
- 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
- Exercise 1: User Report
- Exercise 2: Watchdog Script
- Exercise 3: Remove an Invalid Character
- Exercise 4: Condition Testing
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.