/dots

Completely automated desktop setup, configuration and maintenance using Ansible

Primary LanguageShellThe UnlicenseUnlicense

.dots

Desktop

New and upgraded dotfiles, now with Ansible!

What is this?

This is an Ansible project I use to configure and maintain my personal workstations, install software, manage dotfiles, manage the configuration and more.

Danger, Will Robinson!

For obvious reasons, you should not apply this configuration on your own machine. Doing so will break your stuff, replace it with my stuff and possibly, kill your cat or any other household pets you might have in the immediate vicinity. However, you can definitely use this repository to bootstrap your own setup and to try it all out on a disposable virtual machine.

The master branch is comptible with Debian 10 (buster). There is a specific branch designed for Ubuntu 20.04.

Goals and non-goals

The goal is to be able to configure my desktop environment on a fresh machine installs as fast as possible and with as few manual steps as possible.

Having a production grade Ansible project is not a goal of this repository, however I will try my best to keep the roles and such somewhat maintainable for the benefit of my own, personal sanity. If you are looking for examples on how to write production Ansible roles to be shared with others - this is NOT a good example (though it could help you get started). Many shortcuts have been taken here because it is acceptable to me.

What is automated

  • Large portion of the operating system installation (see autoinstall.conf).
  • Personal dotfiles, shell setup, etc.
  • Nearly all the software I use on my workstations (sans user configs @ todo).
  • Defaults for themes, fonts, dconf settings for GNOME3 and extensions.
  • Some security defaults, SSHD config etc.

Components

dconf settings and system defaults

Desktop user experience configuration is set as a system wide default profile instead of using per-user settings. This is done on purpose - not all of my machines are exactly the same and by using system defaults I can still override some settings locally without having them later reverted by Ansible.

How to use

Using pre-seed (automated) installation

  1. Boot from Debian install ISO
  2. When the graphical installer boot menu appears, press ESC
  3. Type auto url=https://raw.githubusercontent.com/Addvilz/dots/master/autoinstall.conf
  4. Finish the installation and fill out whatever information was not provided by pre-seed (such as storage, etc.)
  5. SSH or sign in to the machine
  6. Change working directory to /opt/dots
  7. Edit group_vars/all.yml as required
  8. As a regular user (probably the same as in group_vars/all.yml), execute Ansible as shown bellow:

ansible-playbook -i hosts site.yml -K -C to run Ansible in check mode. ansible-playbook -i hosts site.yml -K to run Ansible against localhost.

Setup requires root privileges (but of course it does). Ansible will ask you for your password to become root user. This is required because Ansible automates package installation, changes settings only accessible to root etc.

Using manual installation

  1. Set up machine with basic installation of Debian with no desktop environment. Only base system and "Standard system utilities" are required. SSH server is required if you plan to complete the installation remotely.
  2. Move to non-default TTY or SSH into the machine remotely.
  3. Install Ansible and other dependencies sudo apt install python3 python3-pip git
  4. Install Ansible sudo pip3 install ansible
  5. Clone this repository somewhere. I usually use ~/dots/.
  6. Edit group_vars/all as required.
  7. As a regular user (probably the same as in group_vars/all.yml), execute Ansible as shown bellow:

ansible-playbook -i hosts site.yml -K -C to run Ansible in check mode. ansible-playbook -i hosts site.yml -K to run Ansible against localhost.

Setup requires root privileges (but of course it does). Ansible will ask you for your password to become root user. This is required because Ansible automates package installation, changes settings only accessible to root etc.

How to modify and use

  1. Fork this repository.
  2. Review and modify workstation main task collection.
  3. Review and modify files and templates.
  4. Review and modify group_vars.
  5. Commit and push your changes to your fork.
  6. Follow the "How to use" as described above.

IMPORTANT: you should NEVER add anything you want to keep secret to a public repository, including passwords, private keys and such.

Things not yet automated

Known issues

  • During initial setup, dconf update might not be executed properly and might need to be run second time manually after all changes are applied. Simply sign in and run dconf update as root.

Motivation

Till about June 2020, Elementary was my distribution of choice for all of my personal workstation machines. All of them were semi-managed using a combination of shell scripts and manual work.

Several changes in Elementary itself, Ubuntu upstream, and some less objective reasons (I was really bored one night) lead me to the decision that Elementary might no longer fit my personal use case as well as it did when I first started using it. GNOME has changed a lot since 2012, and so has everything related to it.

I tried several distributions for a couple of days each to determine how they could integrate into my workflows and daily life, finally settling on Debian with which I have a long prior history - it is my operating system of choice for all my personal servers, and was my main desktop operating system before mid-2012, before I moved to Elementary. In fact, the very first Linux operating system I was ever exposed to was Debian, version 2.2 at the time - almost 20 years ago.

While having a spare machine set aside to try an operating system is fairly trivial, moving your entire "baggage" of tools, configuration and software to similar, albeit somewhat different distribution is not nearly so - especially if you have multiple machines to maintain - several of which I use daily with several more that I use occasionally, but still require having the same setup as my daily use machines.

This Ansible project was created to deal with the issue of synchronizing the working environments across all of my physical machines and keep their configuration more or less the same over extended periods of time.

Credits

Wallpaper artwork - "Small Memory" © Mikael Gustafsson - Dribbble - Twitter.

But but but my bootstrap scripts and manual copy-pasting of everything?!

Haha Ansible manifests go brrr