How I Manage my System and Dotfiles (with Ansible) ๐Ÿ”ฅ

Shrijal AcharyaShrijal Acharya
3 min read

The Problem ๐Ÿค•

Wait... before I share the problem with you, I first need to make sure that you're on the right machine. I assume you are on Linux or macOS, as I am not so sure if this plays well with Windows.

So, what's the problem we're trying to solve here?

As the title should already suggest, the idea is to configure and manage your system and dotfiles with Ansible (yes, you heard it correctly) and not GNU Stow.

Shocked Dog

But why go through all this, right? Well, setting up a system is usually a one-time thing and not something you have to do over and over, when you mostly stick with one system.

But wait... what if you suddenly need to? Like, you've got two different machines, maybe one macOS and one Linux, or even two of the same kind, or you need to set up your office computer just the way you like it.

Now, do you see the pain that you might have to go through?


The Solution

At the very least, managing your dotfiles is super important. If you are not already managing them properly, you're doing things really wrong, my friend.

There's two different efficient ways of handling this:

1. GNU Stow

With stow, you're mainly talking about "managing system and dotfiles," system management is completely out of play.

Most folks don't really care about automating system management and just prefer managing dotfiles, and that's perfectly fine. You'll find tons of different videos on YT explaining how to do it.

Here's the video that sold Stow to me a year ago: Link

I've been using this method for over a year to handle my dotfiles, and you can check out my "Stow" way of managing dotfiles here: Link

But, this is not the focus for this blog, let's continue to Ansible...

2. Ansible

When you think of Ansible, you probably think of a tool for managing systems. But guess what? You can totally use it to handle your dotfiles too.

So, how did I come up with the idea to use Ansible for managing my system and dotfiles?

It wouldn't be fair if I didn't mention TechDufus. His setup really looked slick and mine configuration is highly based on his.

You can check out my repository here: Link

Everything's managed by Ansible, so if you know the basics, it's pretty easy to follow.

Here's the setup in action where I set up two fresh Ubuntu machines with my configuration: Link


Conclusion

With this setup, you can not only manage your dotfiles but also set up a new machine just the way you like it, including all the packages you need, with just one command.

Once you get the hang of this setup, I bet you won't need anything else anytime soon, since it even takes care of system management, which was something GNU Stow couldn't do.

My configuration is still new, and I'm working on tweaking the workflow to use Ansible.

Feel free to drop any suggestions or let me know if I'm missing something! โœŒ๏ธ

Bye Bye GIF

0
Subscribe to my newsletter

Read articles from Shrijal Acharya directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shrijal Acharya
Shrijal Acharya

I've been interested in Software and Security for over two years and am currently honing my skills. I know about Cloud Computing, DevOps, and Web Development. Aside from these, I have web security experience and have assisted many companies and universities, including Monash University, GymShark, and a few others.