title: Specify different user name for each remote host
body: <p>I am doing a deployment on 3 different remote hosts and they all have different users and passwords. I am trying to add those to my files so that they are not prompted during execution. </p>
  
  <p>I have tried adding them to the group_vars folder. </p>
  
  <pre><code> my_group:
   host1:
   ansible_ssh_user: user1
   ansible_ssh_pass: pass1
  
   host2:
   ansible_ssh_user: user2
   ansible_ssh_pass: pass2
  
   host3:
   ansible_ssh_user: user3
   ansible_ssh_pass: pass3
  </code></pre>
  
  <p>That returns a warning that there is a duplicate dict key and it uses only the value for the first declaration. </p>
  
  <p>I saw a solution of passing it in the playbook: </p>
  
  <pre><code>hosts: host1:host2
  user: abcd 
  tasks: ...
  
  hosts: host3
  user:efgh
  tasks:...
  </code></pre>
  
  <p>I find this solution unsuitable in my case as the tasks I need to execute are the same for all remote hosts. Also there are a lot of tasks and it will be inconvenient to copy paste them several times in one playbook. It doesn't let me add a pass as well. </p>
  
  <p>How do I specify a username and password for each remote host?</p>