Merge branch 'option-updates' of git://github.com/jlund/ansible into devel

Conflicts:
	bin/ansible-pull
This commit is contained in:
Michael DeHaan 2013-06-30 19:31:37 -04:00
commit c2988dfdb0
4 changed files with 14 additions and 18 deletions

View file

@ -60,8 +60,6 @@ class Cli(object):
parser.add_option('-m', '--module-name', dest='module_name',
help="module name to execute (default=%s)" % C.DEFAULT_MODULE_NAME,
default=C.DEFAULT_MODULE_NAME)
parser.add_option('--list-hosts', dest='listhosts', action='store_true',
help="dump out a list of hosts matching input pattern, does not execute any modules!")
options, args = parser.parse_args()
self.callbacks.options = options

View file

@ -52,10 +52,9 @@ def main(args):
''' run ansible-playbook operations '''
# create parser for CLI options
usage = "%prog playbook.yml"
parser = utils.base_parser(
constants=C,
usage=usage,
usage = "%prog playbook.yml",
connect_opts=True,
runas_opts=True,
subset_opts=True,
@ -66,17 +65,14 @@ def main(args):
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',
help="do a playbook syntax check on the playbook, do not execute the playbook")
help="perform a syntax check on the playbook, but do not execute it")
parser.add_option('--list-tasks', dest='listtasks', action='store_true',
help="do list all tasks that would be executed")
help="list all tasks that would be executed")
parser.add_option('--step', dest='step', action='store_true',
help="one-step-at-a-time: confirm each task before running")
parser.add_option('--start-at-task', dest='start_at',
help="start the playbook with a task matching this name")
help="start the playbook at the task matching this name")
options, args = parser.parse_args(args)

View file

@ -98,18 +98,18 @@ def main(args):
usage = "%prog [options] [playbook.yml]"
parser = OptionParser(usage=usage)
parser.add_option('--purge', default=False, action='store_true',
help='Purge git checkout after playbook run')
help='purge git checkout after playbook run')
parser.add_option('-o', '--only-if-changed', dest='ifchanged', default=False, action='store_true',
help='Only run the playbook if the repository has been updated')
help='only run the playbook if the repository has been updated')
parser.add_option('-d', '--directory', dest='dest', default=None,
help='Directory to clone git repository to')
help='directory to clone the git repository to')
parser.add_option('-U', '--url', dest='url', default=None,
help='URL of git repository')
help='URL of the git repository')
parser.add_option('-C', '--checkout', dest='checkout',
default="HEAD",
help='Branch/Tag/Commit to checkout. Defaults to HEAD.')
help='branch/tag/commit to checkout; defaults to HEAD')
parser.add_option('-i', '--inventory-file', dest='inventory',
help="specify inventory host file")
help="location of the inventory host file")
options, args = parser.parse_args(args)
if not options.dest:

View file

@ -469,6 +469,8 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False,
help='use this file to authenticate the connection')
parser.add_option('-K', '--ask-sudo-pass', default=False, dest='ask_sudo_pass', action='store_true',
help='ask for sudo password')
parser.add_option('--list-hosts', dest='listhosts', action='store_true',
help='outputs a list of matching hosts; does not execute anything else')
parser.add_option('-M', '--module-path', dest='module_path',
help="specify path(s) to module library (default=%s)" % constants.DEFAULT_MODULE_PATH,
default=None)
@ -510,12 +512,12 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False,
if check_opts:
parser.add_option("-C", "--check", default=False, dest='check', action='store_true',
help="don't make any changes, instead try to predict some of the changes that may occur"
help="don't make any changes; instead, try to predict some of the changes that may occur"
)
if diff_opts:
parser.add_option("-D", "--diff", default=False, dest='diff', action='store_true',
help="when changing (small) files and templates, show the differences in those files, works great with --check"
help="when changing (small) files and templates, show the differences in those files; works great with --check"
)