Expose remote_port option in playbook

This commit is contained in:
Michael DeHaan
2012-03-28 19:31:17 -04:00
parent a05b75dbbb
commit b30ddc4520
3 changed files with 15 additions and 8 deletions

View File

@@ -75,6 +75,7 @@ class Cli(object):
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

View File

@@ -43,6 +43,9 @@ def main(args):
help="path to module library", default=C.DEFAULT_MODULE_PATH)
parser.add_option('-O', '--override-hosts', dest="override_hosts", default=None,
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")
@@ -73,6 +76,7 @@ def main(args):
forks=options.forks,
verbose=True,
remote_pass=sshpass,
remote_port=options.remote_port,
callbacks=playbook_cb,
runner_callbacks=runner_cb,
stats=stats,