---
title: How To Automate Your Dev Setup
kind: note
description: 'Link Video Notes From the video Installing a development environment that is not easily reproducable is technical debt. Exceptions that should not be automated: System updates - you don''t want risking…'
words: 198
readingMinutes: 1
created: '2024-11-03T00:00:00.000Z'
updated: '2024-11-03T10:45:02+01:00'
website: https://www.youtube.com/watch?v=V_Cj_p6se3k
---
## Link

<https://www.youtube.com/watch?v=V_Cj_p6se3k>

## Video


<div class="youtube-embed"><iframe src="https://www.youtube-nocookie.com/embed/V_Cj_p6se3k" title="How To Automate Your Dev Setup - YouTube" loading="lazy" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>


## Notes
### From the video
- Installing a development environment that is not easily reproducable is technical debt.
- Exceptions that should not be automated:
	- **System updates** - you don't want risking things to break in the middle of a development session.
- The bootstrap script (`~/.dotfiles/bin/dotfiles`) is run as the regular user, but contains `sudo ...` statements where necessary, e.g. if this is being run on a new system and [Ansible](/notes/ansible) needs to be installed.
- `ansible-galaxy install -r requirements.yml` installs all collections specified in a `requirements.yml` file.
- [Bash](/notes/bash) scripting titbits: ^e00c9b
	- `if ! [ -x "$(command -v ansible)" ]; then ... fi`:
		- If the command `ansible` is not executable (or does not even exist), then ...
	- `if ! [[ -f "$SSH_DIR/id_rsa" ]]; then ... fi`:
		- If the file `$SSH_DIR/id_rsa` does not exist, then ...
	- `set -e` causes the script to exit immediately if any command within the script returns a non-zero exit status
- The goals of automating your development environment are to
	1. save time, and
	2. prevent mistakes.
	- If maintaining playbooks becomes a burden, take a step back and rethink how you are solving the problem.
### From the repo
- By adding `"$@"` as the last argument to `ansible-playbook`, arguments can be passed through the bootstrap script, e.g. `--tags ...` to limit actions.
## Resources
- [Source code from this video](https://github.com/ALT-F4-LLC/dotfiles-test) - i.e. just the bootstrap script
- [Actual dotfiles of this streamer](https://github.com/ALT-F4-LLC/dotfiles)
