From 41195d0d49c0041b4aa32e1db8875dd6d551389e Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Mon, 15 Oct 2012 17:48:25 -0400 Subject: [PATCH] trivial --syntax-check option to ansible to just do the yaml validation check. Lots of room to make this more interesting - but not today --- bin/ansible-playbook | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/ansible-playbook b/bin/ansible-playbook index 64d5ee66e50..5b52cfe967b 100755 --- a/bin/ansible-playbook +++ b/bin/ansible-playbook @@ -59,6 +59,8 @@ def main(args): help="only run plays and tasks tagged with these values") parser.add_option('--list-hosts', dest='listhosts', action='store_true', help="dump out a list of hosts, each play will run against, does not run playbook!") + parser.add_option('--syntax-check', dest='syntax', action='store_true', + help="do a playbook syntax check on the playbook, do not execute the playbook") options, args = parser.parse_args(args) @@ -121,6 +123,11 @@ def main(args): print ' %s' % host print '\n' return 0 + + if options.syntax: + # if we've not exited by now then we are fine. + print 'Playbook Syntax is fine' + return 0 try: