How I automated my Fedora Workstation with "modular" Ansible roles

Recently, I shared this on the /r/Fedora subreddit and it got positive feedback, so I thought I would share it here too.

Inspired by ralphbean/lightsaber and ryansb/workstation, I recently set up Ansible roles to automatically configure and set up my Fedora Workstation. It works great for fresh installs, but it’s also useful for bringing multiple installations in sync.

See them here!

This kind of thing has been done before, but something I liked about the way I did it is my “modular” roles. I separated system/ and app/ roles apart (one for system-level config and one for software / application config). When writing the playbook, it makes it easy to “opt in” to some configurations and create all sorts of unique combinations based on a specific host’s needs.

It felt like making a swiss army knife out of my computer in a way. I thought it was pretty fun to do. :smile:

4 Likes

Recently, I did the same thing for myself. With Ansible you can setup and document your workstation with no hassle. I’m also forcing myself to use the playbook for any config change or package installation. You can see my playbook on Github.

2 Likes

Exactly. Once you force yourself into that habit, it becomes convenient. Since I have a desktop, laptop, and several headless servers, it makes it easy to have consistency across my environment. In my playbooks/ directory, I have different playbooks for Fedora Workstation, RHEL Workstation, and CentOS Server.

The yamllint CI check is a good idea. I might “borrow” that idea from you. :smile:

I recently made some significant changes and got everything into Ansible roles. I also “rebranded” it to swiss-army as a project name. I also added some documentation on how to use it.

1 Like