hello,
Here is a sample inventory that i want to use
[paadadm]
machine1 ansible_ssh_user=admin comment="Sandbox Admin Node"
[paadsrvwbsa]
machine1 ansible_ssh_user=doe comment="Sandbox Node A"
[paadsrvwbsb]
machine2 ansible_ssh_user=anotherone comment="Sandbox Node B"
[paadstack:children]
paadadm
paadsrvwbsa
paadsrvwbsb
if i use this sample playbook
---
- hosts: paadstack
remote_user: '{{ ansible_ssh_user }}'
tasks:
- name: "hello"
debug: msg="hello {{ ansible_ssh_user }}"
i get this output :
PLAY [paadstack] **************************************************************
GATHERING FACTS ***************************************************************
ok: [machine1]
ok: [machine2]
TASK: [hello] *****************************************************************
ok: [machine1] => {
"msg": "hello doe"
}
ok: [machine2] => {
"msg": "hello anotherone"
}
PLAY RECAP ********************************************************************
machine1 : ok=2 changed=0 unreachable=0 failed=0
machine2 : ok=2 changed=0 unreachable=0 failed=0
is it possible not to make an alias on machine1 to have 2 executions on machine1 because users are differents ?