mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Added preliminary support for --sudo to ansible, playbook support and further testing pending.
This commit is contained in:
@@ -67,6 +67,8 @@ class Cli(object):
|
||||
help='condense output')
|
||||
parser.add_option('-P', '--poll', default=C.DEFAULT_POLL_INTERVAL, type='int',
|
||||
dest='poll_interval', help='set the poll interval if using -B')
|
||||
parser.add_option("-s", "--sudo", default=False, action="store_true",
|
||||
dest='sudo', help="run operations with sudo (nopasswd)")
|
||||
parser.add_option('-t', '--tree', dest='tree', default=None,
|
||||
help='log output to this directory')
|
||||
parser.add_option('-T', '--timeout', default=C.DEFAULT_TIMEOUT, type='int',
|
||||
@@ -107,7 +109,7 @@ class Cli(object):
|
||||
host_list=options.inventory, timeout=options.timeout,
|
||||
remote_port=options.remote_port, forks=options.forks,
|
||||
background=options.seconds, pattern=pattern,
|
||||
callbacks=self.callbacks, verbose=True,
|
||||
callbacks=self.callbacks, sudo=options.sudo, verbose=True,
|
||||
)
|
||||
return (runner, runner.run())
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ def main(args):
|
||||
help="run playbook against these hosts regardless of inventory settings")
|
||||
parser.add_option('-p', '--port', default=C.DEFAULT_REMOTE_PORT, type='int',
|
||||
dest='remote_port', help='set the remote ssh port')
|
||||
|
||||
parser.add_option('-T', '--timeout', default=C.DEFAULT_TIMEOUT, type='int',
|
||||
dest='timeout', help="set the SSH timeout in seconds")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user