mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
add support for using an alternate remote port
This commit is contained in:
10
bin/ansible
10
bin/ansible
@@ -73,6 +73,8 @@ class Cli(object):
|
||||
dest='timeout', help="set the SSH timeout in seconds")
|
||||
parser.add_option('-u', '--user', default=C.DEFAULT_REMOTE_USER,
|
||||
dest='remote_user', help='connect as this user')
|
||||
parser.add_option('-p', '--port', default=C.DEFAULT_REMOTE_PORT, type='int',
|
||||
dest='remote_port', help='set the remote ssh port')
|
||||
options, args = parser.parse_args()
|
||||
self.callbacks.options = options
|
||||
|
||||
@@ -101,8 +103,9 @@ class Cli(object):
|
||||
module_name=options.module_name, module_path=options.module_path,
|
||||
module_args=shlex.split(options.module_args),
|
||||
remote_user=options.remote_user, remote_pass=sshpass,
|
||||
host_list=options.inventory, timeout=options.timeout,
|
||||
forks=options.forks, background=options.seconds, pattern=pattern,
|
||||
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,
|
||||
)
|
||||
return (runner, runner.run())
|
||||
@@ -116,7 +119,8 @@ class Cli(object):
|
||||
module_args=[ "jid=%s" % jid ], remote_user=old_runner.remote_user,
|
||||
remote_pass=old_runner.remote_pass, host_list=hosts,
|
||||
timeout=old_runner.timeout, forks=old_runner.forks,
|
||||
pattern='*', callbacks=self.silent_callbacks, verbose=True,
|
||||
remote_port=old_runner.remote_port, pattern='*',
|
||||
callbacks=self.silent_callbacks, verbose=True,
|
||||
)
|
||||
|
||||
# ----------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user