mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Force connection to local when localhost is delegated to
This commit is contained in:
parent
97e8d25eb4
commit
7a815b7296
1 changed files with 3 additions and 1 deletions
|
@ -358,7 +358,9 @@ class PlayContext(Base):
|
||||||
if connection_type in delegated_vars:
|
if connection_type in delegated_vars:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
if getattr(new_info, 'connection', None) == 'local' and new_info.remote_addr not in C.LOCALHOST:
|
if new_info.remote_addr in C.LOCALHOST:
|
||||||
|
setattr(new_info, 'connection', 'local')
|
||||||
|
elif getattr(new_info, 'connection', None) == 'local' and new_info.remote_addr not in C.LOCALHOST:
|
||||||
setattr(new_info, 'connection', C.DEFAULT_TRANSPORT)
|
setattr(new_info, 'connection', C.DEFAULT_TRANSPORT)
|
||||||
elif task._local_action:
|
elif task._local_action:
|
||||||
# otherwise, in the special instance that the task was specified
|
# otherwise, in the special instance that the task was specified
|
||||||
|
|
Loading…
Reference in a new issue