Support templating in ansible_user

Before this change it is not possible to use templating for the ansible_user e.g:

  ansible_user: "{{ some_variable }}"
This commit is contained in:
jovial 2022-03-25 12:00:30 +00:00 committed by GitHub
parent 62d060a173
commit 7ac665a0aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -347,6 +347,7 @@ class ActionModule(ActionBase):
else:
user = task_vars.get('ansible_user') or self._play_context.remote_user
user = self._templar.template(user)
# Private key handling
# Use the private_key parameter if passed else use context private_key_file