Managing a Static Website (Hugo) with Ansible and OpenBSD

Post at — Feb 09, 2023

Embrace Simplicity, Eradicate Kubernetes

I recently wrote a blog post complaining about Oracle Cloud being too Oracle-ish (which, duh…) Oracle Cloud provides two free ARM64 virtual machines which can run Linux or FreeBSD. I mean free is free, right? (the answer to that is emphatically no) so I jumped on board to give it a whirl. I migrated this website to a FreeBSD ARM64 instance and everything went swimmingly.

Ok, so far so good. During the migration of this website, I realized that I had made the management of the site itself way more difficult than it needed to be. (I blame my time spent in the trenches of a large Kubernetes cluster management… never again…) But I chalked it up to that's modern website hosting, what're going to do?! :shrug: and promptly didn’t look at it again.

Until a few weeks later when I decided to upload a new blog post. Unfortunately, I had made the process too complex for my aging brain to easily recover from long term storage. I found I had installed multiple jails on the FreeBSD host system to perform various tasks. One for the hugo installation, another for the webserver, and another for a purpose that I completely forget offhand. At the time of building the system all of the jails seemed important (this is Stockholm Kubernetes syndrome at work).

Thus, in a fit of pique with past John I decided to simplify my life and migrate away from a containerized system and to a simple webhost. So I installed OpenBSD on a Vultr VPS, setup httpd with SSL and migrated jrgsystems to it.

My new process for updating the blog is

  1. startup “hugo serve -D” on my laptop in the base directory of my website repo
  2. edit a new blog post markdown file
  3. once I’m happy with post, generate page with “hugo”
  4. copy generated static site to OpenBSD using ansible playbook
  5. commit the changes to git

This workflow is easy for me to remember because I’m almost always at a system where hugo and ansible are just a simple package install away.

Admittedly, I’m writing this blog post in order to facilitate tucking this new procedure into long term brain storage (it’s also in obsidian)!

update_website.yaml

1
2
3
4
5
6
7
8
9
- name: update jrgsystems blog
  hosts: all
  tasks:
    - name: Copy updated website into /var/www/htdocs/www.jrgsystems.com
      ansible.posix.synchronize:
        src: /home/jgrafton/git/jrgsystems/public/
        dest: /var/www/htdocs/www.jrgsystems.com
        owner: no
        group: no