This implements a basic --check mode which for now is only implemented on template & copy operations. More detail will be shared with the list

shortly.
This commit is contained in:
Michael DeHaan 2013-02-03 19:46:25 -05:00
commit fed82c2188
21 changed files with 125 additions and 24 deletions

View file

@ -52,11 +52,13 @@ def main(args):
# create parser for CLI options
usage = "%prog playbook.yml"
parser = utils.base_parser(constants=C, usage=usage, connect_opts=True, runas_opts=True, subset_opts=True)
parser = utils.base_parser(constants=C, usage=usage, connect_opts=True,
runas_opts=True, subset_opts=True, check_opts=True)
parser.add_option('-e', '--extra-vars', dest="extra_vars", default=None,
help="set additional key=value variables from the CLI")
parser.add_option('-t', '--tags', dest='tags', default='all',
help="only run plays and tasks tagged with these values")
# FIXME: list hosts is a common option and can be moved to utils/__init__.py
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',
@ -120,6 +122,7 @@ def main(args):
extra_vars=extra_vars,
private_key_file=options.private_key_file,
only_tags=only_tags,
check=options.check
)
if options.listhosts: