Let me add that I encounter the "ansible_user" is undefined issue with both 
stable-2.3 and stable-2.4 branches of the code.

Le samedi 30 septembre 2017 21:32:08 UTC+2, Jerome Wagner a écrit :
>
> Hello,
>
> I thought that when ansible-playbook was used with the "-u" option, then 
> ansible_user was always defined as the "-u" user.
>
> when running the following playbook,
>
> - hosts: mybox
>   gather_facts: no
>   tasks:
>   - name: Echo ansible_user
>     debug:
>       msg: "hello {{ ansible_user }}"
>     become: yes
>     become_user: "{{ansible_user}}"
>
> I get the following error :
>
> The field 'become_user' has an invalid value, which includes an undefined 
> variable. The error was: 'ansible_user' is undefined\nexception type: 
> <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 
> 'ansible_user' is undefined
>
> Why isn't ansible_user available when the become_user template is rendered 
> ?
> Is this a bug ?
>
>
> Thank you for your help
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a38b6886-2588-4385-84cf-55f681d3eab0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to