Home Blog Hire!

Setup Reloaded - Ansible to the rescue  

2017-10-07 Saturday 13:00 UTC

Last year I tried to “semi-automate” my OSX setup, as described in the Mac OS X Setup post. This weekend I enhanced the deployment using Ansible.

If you are interested have a look into my dotfile repository. The setup for now only supports OSX, but is already a big step forward for me.

Sample cli setup

Usage

  1. Clone repo git clone git@github.com:lony/dotFiles.git
  2. Customize all_secret.sh and maybe .ssh/config (see SSH guide)
  3. Execute ./setup.sh

Feature

Architecture

  1. The setup.sh installs OS specific Ansible prequesites and starts Ansible
  2. Ansible has multiple roles which each are triggered
  3. The dotfile role contains a Python script which creates shell scripts for bash, zsh and fish

Structure

❯ tree  -L 5 (custom)
.
├── README.md                     - This readme
├── ansible
│   ├── README.md                 - Ansible links
│   ├── roles
│   │   ├── dotfiles              - First role for dotfiles
│   │   │   ├── bin
│   │   │   │   └── bootstrap.py  - Custom Python script
│   │   │   ├── src               - Dotfiles
│   │   │   └── tasks
│   │   │       └── main.yml      - Task executed by Ansible
│   │   ├── homebrew
│   │   │   ├── tasks
│   │   │   └── vars
│   │   │       └── main.yml      - Variables used by Ansible
│   │   ├── homebrew_cleanup
│   │   ├── python
│   │   ├── tmux
│   │   ├── vim
│   │   └── zsh_oh-my-zsh
│   └── site.yml                  - Ansible playbook definition
└── setup.sh                      - Script to prepare OS for Ansible

Thanks

This is heavily inspired by the work of the following people:

  • Dominik’s - basic idea for bash, zsh, vim and tmux
  • Christopher - vim plugins
  • Michael - cli tooling e.g. httpie, jq
  • Sebastian’s - homebrew setup, tmux enhancing
  • Florian - fish support
  • Jeff’s - Ansible deployment
  • Chavez’s - Ansible bootstrapping and vim, tmux enhanced setup

© Goetz Epperlein 2016 - 2018   Imprint     Privacy