Skip to content

Instantly share code, notes, and snippets.

@nmandery
Last active August 29, 2015 14:25
Show Gist options
  • Save nmandery/b8e39d40bfbe84a2c822 to your computer and use it in GitHub Desktop.
Save nmandery/b8e39d40bfbe84a2c822 to your computer and use it in GitHub Desktop.
Ansible playbook to install the dotfiles from github.com/nmandery/dotfiles
# vi: set ft=yml
---
- hosts: all
sudo: no
vars:
dotfiles_dir: "{{ansible_user_dir}}/.dotfiles"
handlers:
- name: purge cached system packages
shell: apt-get clean
sudo: yes
tasks:
- name: Update apt cache (just once)
apt: update_cache=yes
sudo: yes
- name: Install base packages
apt: name={{item}} state=present
with_items:
- git
- vim
- htop
- exuberant-ctags
- python
sudo: yes
notify: purge cached system packages
- name: Clone dotfiles from github
git: repo=http://github.com/nmandery/dotfiles dest={{dotfiles_dir}} update=yes
register: git_result
- name: Run dotfiles installer
shell: bash install.sh
args:
chdir: "{{dotfiles_dir}}"
when: git_result.changed
@nmandery
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment