mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Allow user to be passed in via --extra-vars
This commit is contained in:
parent
98a5565106
commit
07f459f3b2
2 changed files with 4 additions and 1 deletions
|
@ -68,7 +68,7 @@ class Play(object):
|
|||
self.vars = self._get_vars(self.playbook.basedir)
|
||||
self._tasks = ds.get('tasks', [])
|
||||
self._handlers = ds.get('handlers', [])
|
||||
self.remote_user = ds.get('user', self.playbook.remote_user)
|
||||
self.remote_user = utils.template(ds.get('user', self.playbook.remote_user), playbook.extra_vars)
|
||||
self.remote_port = ds.get('port', self.playbook.remote_port)
|
||||
self.sudo = ds.get('sudo', self.playbook.sudo)
|
||||
self.sudo_user = ds.get('sudo_user', self.playbook.sudo_user)
|
||||
|
|
|
@ -56,6 +56,9 @@ class ParamikoConnection(object):
|
|||
raise errors.AnsibleError("paramiko is not installed")
|
||||
|
||||
user = self.runner.remote_user
|
||||
|
||||
vvv("ESTABLISH CONNECTION FOR USER: %s" % user, host=self.host)
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
|
||||
|
|
Loading…
Reference in a new issue