mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Accessing a node that doesn't exist throws an exception
This commit is contained in:
parent
556799a7c4
commit
19797e1a29
1 changed files with 6 additions and 3 deletions
|
@ -391,9 +391,12 @@ class Runner(object):
|
||||||
delegate_to = inject.get('delegate_to', None)
|
delegate_to = inject.get('delegate_to', None)
|
||||||
if delegate_to is not None:
|
if delegate_to is not None:
|
||||||
delegate_to = utils.template(self.basedir, delegate_to, inject)
|
delegate_to = utils.template(self.basedir, delegate_to, inject)
|
||||||
delegate_info = inject['hostvars'][delegate_to]
|
try:
|
||||||
actual_host = delegate_info.get('ansible_ssh_host', delegate_to)
|
delegate_info = inject['hostvars'][delegate_to]
|
||||||
actual_port = delegate_info.get('ansible_ssh_port', port)
|
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:
|
try:
|
||||||
# connect
|
# connect
|
||||||
|
|
Loading…
Reference in a new issue