mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Accessing a node that doesn't exist throws an exception
This commit is contained in:
@@ -391,9 +391,12 @@ class Runner(object):
|
||||
delegate_to = inject.get('delegate_to', None)
|
||||
if delegate_to is not None:
|
||||
delegate_to = utils.template(self.basedir, delegate_to, inject)
|
||||
delegate_info = inject['hostvars'][delegate_to]
|
||||
actual_host = delegate_info.get('ansible_ssh_host', delegate_to)
|
||||
actual_port = delegate_info.get('ansible_ssh_port', port)
|
||||
try:
|
||||
delegate_info = inject['hostvars'][delegate_to]
|
||||
actual_host = delegate_info.get('ansible_ssh_host', delegate_to)
|
||||
actual_port = delegate_info.get('ansible_ssh_port', port)
|
||||
except errors.AnsibleError:
|
||||
actual_host = delegate_to
|
||||
|
||||
try:
|
||||
# connect
|
||||
|
||||
Reference in New Issue
Block a user