My own Ansible collection for development setup (use by your own risk).
- GitHub repo: https://github.com/fedejaure/dev-setup.git
- Free software: MIT
- Firefox
- Google Chrome
- Docker
- Openvpn Client
- dockutil
- Visual Studio Code
- Terminess Nerd Font
- Zoom
- Tad
- Keybase
- Obsidian
- Ultimaker Cura
- Elgato Stream Deck
- Spotify
- Alacritty
- git
- openssl
- readline
- xz
- sqlite
- gcc
- cmake
- zlib
- tcl-tk
- pipx
- luarocks
- neovim
- tmux
- chezmoi
- lazydocker
- sshpass
- htop
- dust
- duf
- bat
- Fish Shell
- Starship
- pipenv
- cookiecutter
- poetry with:
- nox with:
-
Ensure Apple's command line tools are installed (xcode-select --install to launch the installer).
-
Download this repository to your local drive.
-
Install requirements:
Create a temporary virtualenv, activate the virtualenv and install ansible:
$ /usr/bin/python3 -m venv .venv $ . .venv/bin/activate (.venv)$ pip3 install ansible
-
Install ansible requirements
ansible-galaxy install -r requirements.yml
. -
Copy
inventory.example
intoinventory
. -
Run
ansible-playbook playbooks/main.yml --ask-become-pass -i inventory
.
Note: You need to agree to Xcode's license.
$ sudo xcodebuild -license
-
Clone this repository.
-
Install dependencies:
$ poetry install --no-root Using python3.10 (3.10.8) Creating virtualenv .venv Installing dependencies from lock file Package operations: 97 installs, 0 updates, 0 removals ...
-
Activate the virtual environment:
$ poetry shell Using python3.10 (3.10.8) Spawning shell within .venv (dev-setup)$
-
Install required Ansible roles:
(dev-setup)$ inv galaxy-install
-
Configure the
inventory
file:-
Local target:
Copy
inventory.example
intoinventory
. -
Remote target:
Configure the
inventory
file as:[macos] <ip address or hostname of the target> ansible_user=<target user> ansible_python_interpreter=/usr/bin/python3
-
Ensure Apple's command line tools are installed (xcode-select --install to launch the installer).
-
Go to System Preferences > Sharing.
-
Enable 'Remote Login'.
You can also enable remote login on the command line:
$ sudo systemsetup -setremotelogin on
Note: You need to agree to Xcode's license.
$ sudo xcodebuild -license
-
-
-
Run the playbook:
(dev-setup)$ inv playbook --ask-pass --ask-become-pass
-
Enjoy!
The tags available are:
- always
- dock
- homebrew
- mas
- oh-my-zsh
- pipx
- pyenv
You can override the defaults configured in default..config.yml by creating a .config.yml file and setting the overrides in that file. e.g.:
---
mas_email: "example@example.com"
homebrew_installed_packages:
- git
- openssl
- readline
- xz
- sqlite
- gcc
- cmake
- zlib
- tcl-tk
- pipx
- luarocks
- neovim
- tmux
- chezmoi
- jesseduffield/lazydocker/lazydocker
- esolitos/ipa/sshpass
- htop
- dust
- duf
- bat
- fish
- starship
- awscli
- tfenv
- ffmpeg
homebrew_cask_apps:
- firefox
- google-chrome
- docker
- openvpn-connect
- hpedrorodrigues/tools/dockutil
- font-terminess-ttf-nerd-font
- visual-studio-code
- zoom
- tad
- keybase
- obsidian
- google-cloud-sdk
- ultimaker-cura
- elgato-stream-deck
- spotify
- alacritty
pyenv_python_versions:
- 3.7.15
- 3.8.15
- 3.9.15
- 3.10.8
- 3.11.0
Development
To display available tasks run:
(dev-setup)$ inv --list
Available tasks:
ansible-lint Run ansible linter.
clean Run all clean sub-tasks.
clean-python Clean up python file artifacts.
format Format code.
galaxy-install Install ansible-galaxy requirements.
hooks Run pre-commit hooks.
install-hooks Install pre-commit hooks.
lint Run all linting.
mypy Run mypy.
playbook Run Ansible playbooks, executing the defined tasks on the targeted hosts.
ruff Run ruff.
security Run security related checks.
tests Run ansible molecule test.
version Bump version.
yamllint Run yamllint, a linter for YAML files.
This playbook was created in 2020 by Federico Jaureguialzo.