add support for using an alternate remote port

This commit is contained in:
Christopher Johnston
2012-03-28 14:05:31 -07:00
parent 9777653741
commit f06ec76fdb
5 changed files with 17 additions and 10 deletions

View File

@@ -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,
)
# ----------------------------------------------