Skip to content

Instantly share code, notes, and snippets.

@rdhyee
Created October 11, 2013 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdhyee/6941909 to your computer and use it in GitHub Desktop.
Save rdhyee/6941909 to your computer and use it in GitHub Desktop.
my version of the ansible playbook taste.yml based on the Ansible chapter of Matt Jaynes' Taste Test (http://devopsu.com/books/taste-test-puppet-chef-salt-stack-ansible.html).
- hosts: all
tasks:
- name: ensure nginx is installed
action: apt pkg=nginx state=present
- hosts: puppy
vars:
baby: puppy
tasks:
- name: ensure nginx is installed
action: apt pkg=nginx state=present
- name: ensure nginx is running
action: service name=nginx state=started
- name: ensure puppy group is present
action: group name=puppy state=present
- name: ensure puppy user is present
action: user name=puppy state=present group=puppy
- name: ensure puppy.jpg is present
action: copy src=/Users/raymondyee/D/Document/Working_with_Open_Data/working-open-data/notebooks/puppy.jpg/
dest=/usr/share/nginx/www/puppy.jpg
owner=puppy group=puppy mode=664
- name: ensure index.html is installed
action: template src=/Users/raymondyee/D/Document/Working_with_Open_Data/working-open-data/notebooks/index.j2
dest=/usr/share/nginx/www/index.html
- hosts: kitty
vars:
baby: kitty
tasks:
- name: ensure nginx is installed
action: apt pkg=nginx state=present
- name: ensure kitty group is present
action: group name=kitty state=present
- name: ensure kitty user is present
action: user name=kitty state=present group=kitty
- name: ensure kitty.jpg is present
action: copy src=/Users/raymondyee/D/Document/Working_with_Open_Data/working-open-data/notebooks/kitty.jpg/
dest=/usr/share/nginx/www/kitty.jpg
owner=kitty group=kitty mode=664
- name: ensure index.html is installed
action: template src=/Users/raymondyee/D/Document/Working_with_Open_Data/working-open-data/notebooks/index.j2
dest=/usr/share/nginx/www/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment