Merge branch 'master' of /git/ansible

This commit is contained in:
Ricky Elrod 2013-03-16 17:55:46 +00:00
commit 5cbe27174f
5 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,21 @@
# requires --extra-vars="target='host1;host2;group etc'
- name: run a playley
hosts: $target
user: root
gather_facts: false
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- $private/vars.yml
tasks:
- name: populate my target group
action: add_host groupname=parent_group hostname=$item
with_items: $hosts
- include: $basedir/playlets/test/book.yml

36
playlets/README Normal file
View file

@ -0,0 +1,36 @@
playlets are self-contained playbooks which are never intended to be
directly executed. They are only to be used as an 'include' from our other
playbooks.
All of these playbooks must have:
hosts: $parent_group
the general structure is:
playlet_name/
vars/vars.yml
files/myfile.conf
myfile2.conf.j2
handlers/handlers.yml
book.yml
template for book.yml
---
- name: give the play let a name
hosts: $parent_group
tags:
- playlet_tag_name
vars_files:
- vars/somefile.yml
tasks:
- name: my task
action: stuff which I do

12
playlets/test/book.yml Normal file
View file

@ -0,0 +1,12 @@
---
- name: test playlet
hosts: parent_group
tags:
- playlet_tag_name
vars_files:
- vars/vars.yml
tasks:
- name: my task 1
action: copy src=files/${myfile} dest=/tmp/${myfile}.txt

2
playlets/test/files/foo Normal file
View file

@ -0,0 +1,2 @@
this is foo
it should end up in /tmp

View file

@ -0,0 +1,2 @@
---
myfile: foo