if remote_user: is used rather than user: the substitutions seem to work.

On Thursday, June 16, 2016 at 7:36:47 PM UTC-4, Tim Daley wrote:
>
> I have the following snippet from my playbook. The hosts: substitutes just 
> fine, but the user: gives "SSH Error: command-line line0: garbage at end of 
> line; "{{ username }}". Is substitution of the user possible?
>
> Enter code here...
> - Other stuff
>
>    - set_fact: username="user"
>
> - name: gather facts
>   hosts: "{{ aws_host_group }}"
>   connections: ssh
>   user: "{{ username }}"
>   become: true
>   vars:
>     - aws_host_group: "{{ aws_type + 'hosts' }}"
>   pre_tasks:
>     - name: Yum Update
>       yum: name='*' state=latest
>
>
> if I delete the register and add the following to my vars: - username: user
>
> The message changes to "SSH Error: command-line line0: garbage at end of 
> line; "user".
>
> This shows that there is at least partial substitution happening.
>

-- 
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/356fed87-ee96-4012-82c1-1783c5df1bba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to