I’ve had a Linode server sitting around doing nothing for almost a year, and I
had an urge to do something with the $5 a month worth of compute.
All of this is a gigantic waste of team for learning’s sake. This could be
done with a lot less time and money just using GitHub Pages and Actions.
The Initial Vision
Server via Ansible. I wanted to be able to build this from a clean Linode
instance without accessing the server.
Automated site build and deploys in Jenkins triggered by a GitHub webhook.
That’s it. This is the first in a short series covering the build.
Initial Server Provisioning
I terminated my existing Linode instance and spun up a fresh one using the
CentOS7 image. Now I was ready to start provisioning the basic services with
The first goal was getting NGINX and Docker installed. I opted for running
NGINX directly on the server for serving static content, like this site, and as
a proxy for any containerized services. The first step was creating a clean
ansible project with a couple roles.
The above play will fail until we create the roles, so we do that next.
Here’s an overview of what this task is doing:
Installs the EPEL Repository where NGINX is distributed
Creates a directory for our letencrypt certificates to live
Sets the default NGINX config from a template creating a default server on
port 80 that redirects all traffic to https
Makes sure the firewall allows inbound traffic on ports 80 & 443
Disables SELinux :( I struggled with this and eventually gave up