mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Merge commit '8ae71cc' into integration
Conflicts: bin/ansible bin/ansible-playbook lib/ansible/utils.py
This commit is contained in:
23
bin/ansible
23
bin/ansible
@@ -47,23 +47,12 @@ class Cli(object):
|
||||
def parse(self):
|
||||
''' create an options parser for bin/ansible '''
|
||||
|
||||
|
||||
options = {
|
||||
'-a' : dict(long='--args', dest='module_args',
|
||||
help="module arguments", default=C.DEFAULT_MODULE_ARGS),
|
||||
'-m' : dict(long='--module-name', dest='module_name',
|
||||
help="module name to execute", default=C.DEFAULT_MODULE_NAME)
|
||||
}
|
||||
|
||||
parser = utils.make_parser(
|
||||
options,
|
||||
usage='%prog <host-pattern> [options]',
|
||||
runas_opts=True,
|
||||
async_opts=True,
|
||||
output_opts=True,
|
||||
|
||||
)
|
||||
|
||||
parser = utils.base_parser(constants=C, runas_opts=True, async_opts=True,
|
||||
output_opts=True, usage='%prog <host-pattern> [options]')
|
||||
parser.add_option('-a', '--args', dest='module_args',
|
||||
help="module arguments", default=C.DEFAULT_MODULE_ARGS)
|
||||
parser.add_option('-m', '--module-name', dest='module_name',
|
||||
help="module name to execute", default=C.DEFAULT_MODULE_NAME)
|
||||
|
||||
options, args = parser.parse_args()
|
||||
self.callbacks.options = options
|
||||
|
||||
@@ -32,14 +32,13 @@ def main(args):
|
||||
''' run ansible-playbook operations '''
|
||||
|
||||
# create parser for CLI options
|
||||
usage = "%prog <playbook-file1 [playbook-file2...]> [options]"
|
||||
options = {
|
||||
'-e' : dict(long='--extra-vars', dest='extra_vars',
|
||||
help='pass in extra key=value variables from outside the playbook'),
|
||||
'-O' : dict(long='--override-hosts', dest="override_hosts", default=None,
|
||||
help="run playbook against only hosts, ignorning the inventory file")
|
||||
}
|
||||
parser = utils.make_parser(options, constants=C, usage=usage)
|
||||
usage = "%prog playbook.yml"
|
||||
parser = utils.base_parser(constants=C, usage=usage)
|
||||
parser.add_option('-e', '--extra-vars', dest='extra_vars',
|
||||
help='arguments to pass to the inventory script')
|
||||
parser.add_option('-O', '--override-hosts', dest="override_hosts", default=None,
|
||||
help="run playbook against these hosts regardless of inventory settings")
|
||||
|
||||
options, args = parser.parse_args(args)
|
||||
|
||||
if len(args) == 0:
|
||||
|
||||
Reference in New Issue
Block a user