Skip to content

Instantly share code, notes, and snippets.

@rob-b
Created May 2, 2013 08:59
Show Gist options
  • Save rob-b/5501046 to your computer and use it in GitHub Desktop.
Save rob-b/5501046 to your computer and use it in GitHub Desktop.
Very basic ansible config
---
- hosts: webservers
user: root
tasks:
- name: create admin group
action: group name=ubuntu gid=1000 system=no
- name: create user
action: user name=ubuntu group=ubuntu shell=/bin/zsh uid=1000
- name: setup authorized key
action: authorized_key user=ubuntu key='$FILE(/Users/rob/.ssh/id_rsa.pub)'
- name: update sudoers
action: template src=templates/sudoers.j2 dest=/etc/sudoers.d/custom owner=root group=root mode=0400
- name: install essentials
apt: pkg=$item state=latest install_recommends=no
with_items:
- zsh
- git
- vim
- python-pip
- name: install virtualenv
pip: name=$item state=latest extra_args='--download-cache=/home/ubuntu/.pip-cache'
with_items:
- virtualenv
- virtualenvwrapper
- hosts: webservers
user: ubuntu
vars:
- user: ubuntu
- home: /home/ubuntu
tasks:
- name: clone dotfiles
git: repo=https://[email protected]/rob_b/dotfiles.git dest=${home}/.dotfiles
- name: install dotfiles
command: ${home}/.dotfiles/install-links.sh creates=${home}/.vimrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment