Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
/ ansible-laptop Public archive

Install all the things on a new laptop with Ansible!

License

Notifications You must be signed in to change notification settings

jackdbd/ansible-laptop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible laptop setup

Ansible Playbook that I use to setup a new laptop.

INSTALL ALL THE THINGS!

⚠️ No longer maintained ⚠️

I switched to using Nix as my package manager and Home Manager as the program to manage my HOME directory, so I no longer maintain this repository. I now keep the configuration for all of all my programs in this other repository: nix-config.

playbook, roles, tasks, tags

The Ansible playbook playbook.yaml contains several tasks (i.e. the Ansible unit of action) grouped by roles and identified by tags.

ℹ️ Ansible playbooks are essentially sets of instructions (plays) that you send to run on a single target or groups of targets (hosts).

Tasks involving snaps will be executed using the community.general.snap module. All other tasks will use modules of the Ansible.Builtin collection.

ℹ️ I use Xubuntu, but the Ansible tasks that you can find in this playbook should work fine with all other Debian-based Linux distros.

Roles are either defined in playbook.yaml, or declared in requirements.yaml and downloaded from Ansible Galaxy.

You can use tags to run only the tasks you want.

Installation

Download all Ansible roles declared in requirements.yaml:

ansible-galaxy install -r requirements.yaml

Run all tasks tagged with docker (-K means that you have to type your sudo password):

ansible-playbook playbook.yaml -K --tags "docker"

⚠️ Don't forget to logout and login back again after you have added your linux user to the docker group (or simply restart you computer). This way you can run docker commands without prepending them with sudo.

Run all tasks tagged with some tag. For example, run all tasks tagged with either development or productivity:

ansible-playbook playbook.yaml -K --tags "development,productivity"

Troubleshooting

List all tasks tagged with some tag/s

List of all tasks tagged with development, productivity, or both:

ansible-playbook playbook.yaml --list-tasks --tags "development,productivity"

Skip tasks tagged with some tag/s

If Ansible fails to install some task, double check that the playbook does not have any syntactic errors:

ansible-playbook playbook.yaml --syntax-check

then try re-running the playbook and skipping them:

ansible-playbook playbook.yaml -K --skip-tags "productivity"

Ansible stuck at some task

I encountered this problem once, then I realized I typed the wrong become password. Failing to produce any output and/or throwing an error in these kind of situations is a long standing issue with Ansible.

Run tasks in verbose mode

For example:

ansible-playbook playbook.yaml -K --tags "development,productivity" -vvvvv

Slow keyboard shortcuts

If, after the installation is completed, you notice that keyboard shortcuts perform the expected action only after A LOT of time, try uninstalling dbus-user-session as suggested here.

Next steps

I keep my dotfiles in a separate repository, so I can keep reusing them even if I decide to stop using Ansible. Most of my dotfiles are symlinked to my home directory using GNU Stow.

Credits

Here are some resources I found useful and that inspired me to create this repository.

About

Install all the things on a new laptop with Ansible!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published