diff options
author | Christopher Johnston <chjohnst@gmail.com> | 2012-03-28 14:05:31 -0700 |
---|---|---|
committer | Christopher Johnston <chjohnst@gmail.com> | 2012-03-28 14:05:31 -0700 |
commit | f06ec76fdb358612d95b9b8249bebc8b58c86965 (patch) | |
tree | c185adb1abd67f366651bc0f50d063b019d6eb61 /bin | |
parent | 97776537418b95d33efe6c8a521f025f14b803ea (diff) | |
download | ansible-f06ec76fdb358612d95b9b8249bebc8b58c86965.tar.gz |
add support for using an alternate remote port
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ansible | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/ansible b/bin/ansible index 41149ae80e..a2867c2c1d 100755 --- a/bin/ansible +++ b/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, ) # ---------------------------------------------- |