Finally i've found the solution (thx to raphael) : make an inventory alias
[paadsrvwbsa]
*machine1_alias ansible_ssh_host=machine1 *ansible_ssh_user=*doe
*comment="Sandbox
Node A"
Le mardi 18 mars 2014 09:55:19 UTC+1, Hervé Leclerc a écrit :
>
> 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 ?
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/efb298cf-cdaf-4644-851c-8a4b4cca5de4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.