Use default port if ansible_ssh_port is not set for the delegated node

Also add testcase for it.
This commit is contained in:
Daniel Hokka Zakrisson 2012-11-01 11:08:24 +01:00
commit fbda2d4628
4 changed files with 23 additions and 5 deletions

View file

@ -384,6 +384,7 @@ class Runner(object):
interpreters.append(i)
for i in interpreters:
del inject[i]
port = C.DEFAULT_REMOTE_PORT
try:
delegate_info = inject['hostvars'][delegate_to]
actual_host = delegate_info.get('ansible_ssh_host', delegate_to)
@ -393,6 +394,7 @@ class Runner(object):
inject[i] = delegate_info[i]
except errors.AnsibleError:
actual_host = delegate_to
actual_port = port
try:
if actual_port is not None: