From 6d0fd2bfdea1d1f68e90545a511454d531d9353b Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 5 Feb 2012 12:52:07 -0500 Subject: [PATCH] Compress the playbook format for readability --- examples/playbook.yml | 22 ++++++++-------------- lib/ansible/playbook.py | 3 ++- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/examples/playbook.yml b/examples/playbook.yml index b149815e0f..4d5972b4c2 100644 --- a/examples/playbook.yml +++ b/examples/playbook.yml @@ -1,28 +1,22 @@ - pattern: '*' tasks: - - do: - - copy a file - - copy - - [ "/srv/a", "/srv/b" ] - do: - configure template & module variables - - setup - - [ "a=2", "b=3", "c=4" ] + - [ setup, [ "a=2", "b=3", "c=4" ] ] + - do: + - copy a file + - [ copy, [ "/srv/a", "/srv/b" ] ] - do: - template from local file template.j2 to remote location /srv/file.out - - template - - [ '/srv/template.j2', '/srv/file.out' ] + - [ template, [ '/srv/template.j2', '/srv/file.out' ] ] - do: - update apache - - command - - [/usr/bin/yum, update, apache] + - [ command, [/usr/bin/yum, update, apache] ] onchange: - do: - restart apache - - command - - [/sbin/service, apache, restart] + - [ command, [/sbin/service, apache, restart] ] - do: - run bin false - - command - - [/bin/false] + - [ command, [/bin/false] ] diff --git a/lib/ansible/playbook.py b/lib/ansible/playbook.py index f2e92b3415..590b0270f4 100755 --- a/lib/ansible/playbook.py +++ b/lib/ansible/playbook.py @@ -110,7 +110,8 @@ class PlayBook(object): host_list = self.host_list instructions = task['do'] - (comment, module_name, module_args) = instructions + (comment, module_details) = instructions + (module_name, module_args) = module_details namestr = "%s/%s" % (pattern, comment) if conditional: