An ansible playbook to set up my development machine exactly how I like it!
Currently targeting and tested against Pop!_OS 20.04.
git clone https://github.com/KentBrockman/dev-playbook.git
cd dev-playbook
sudo apt install ansible
ansible-playbook --version
ansible-galaxy install -r requirements.yml
host_vars
should contain machine specific configurations in a directory that matches the hostname of your machine (e.g. a laptop should have battery management tools, a desktop does not need those)
group_vars/dev_boxes/vars.yml
contain shared configurations you wish to
apply across all of your hosts.
On first setup, you may have to change the host_vars
directory name or set up your machines hostname ahead of time.
Make sure your host names match what is in inventory and are accessible by SSH.
The slicker way to do this is to set up an ssh config as aliases to host_var
directory names.
Alternatively, use the localhost
connection adapter if you wish to run against only your local machine by targetting localhost with ansible-playbook -l localhost
and not worry about SSH access at all.
Typically you should run with sudo
permission:
ansible-playbook main.yml -l dev_boxes -K
If you want to target a specific box:
ansible-playbook main.yml -l phoenix -K
If running against localhost, you will have to specify variables manually or set up an alias for your variables to also apply on localhost
ansible-playbook main.yml -l localhost --extra-vars @group_vars/dev_boxes/vars.yml --extra-vars @host_vars/<YOUR HOST NAME>/vars.yml -K
Some things are not or should not be automated like logging into accounts. Here is a list of things to do once everything is installed:
- Reboot. After an install not all changes take effect immediately. It is good to reboot before assuming something isn't working.
- Log into any cloud service accounts (Google, Microsoft, etc)
- Log into any applications you've installed (Firefox, Spotify, chat clients, etc)
- If using Visual Studio Code Settings Sync, open VSCode and sync your settings