mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
trivial --syntax-check option to ansible to just do the yaml validation
check. Lots of room to make this more interesting - but not today
This commit is contained in:
parent
036f853d42
commit
41195d0d49
1 changed files with 7 additions and 0 deletions
|
@ -59,6 +59,8 @@ def main(args):
|
||||||
help="only run plays and tasks tagged with these values")
|
help="only run plays and tasks tagged with these values")
|
||||||
parser.add_option('--list-hosts', dest='listhosts', action='store_true',
|
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!")
|
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)
|
options, args = parser.parse_args(args)
|
||||||
|
|
||||||
|
@ -122,6 +124,11 @@ def main(args):
|
||||||
print '\n'
|
print '\n'
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
if options.syntax:
|
||||||
|
# if we've not exited by now then we are fine.
|
||||||
|
print 'Playbook Syntax is fine'
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue