From 83c18a42fa544e2857039fd4bc083c3507c742cb Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Fri, 15 Mar 2013 22:22:22 +0000 Subject: [PATCH] demo playlet - as a trial to work out bugs --- playlets/README | 36 ++++++++++++++++++++++++++++++++++++ playlets/test/book.yml | 12 ++++++++++++ playlets/test/files/foo | 2 ++ playlets/test/vars/vars.yml | 2 ++ 4 files changed, 52 insertions(+) create mode 100644 playlets/README create mode 100644 playlets/test/book.yml create mode 100644 playlets/test/files/foo create mode 100644 playlets/test/vars/vars.yml diff --git a/playlets/README b/playlets/README new file mode 100644 index 0000000000..47808aa55b --- /dev/null +++ b/playlets/README @@ -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 + + + \ No newline at end of file diff --git a/playlets/test/book.yml b/playlets/test/book.yml new file mode 100644 index 0000000000..04a5cd29dc --- /dev/null +++ b/playlets/test/book.yml @@ -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}.txt dest=/tmp/${myfile}.txt + diff --git a/playlets/test/files/foo b/playlets/test/files/foo new file mode 100644 index 0000000000..4f41d26438 --- /dev/null +++ b/playlets/test/files/foo @@ -0,0 +1,2 @@ +this is foo +it should end up in /tmp diff --git a/playlets/test/vars/vars.yml b/playlets/test/vars/vars.yml new file mode 100644 index 0000000000..fb4b5f0414 --- /dev/null +++ b/playlets/test/vars/vars.yml @@ -0,0 +1,2 @@ +--- +myfile: foo