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/a9d48107-2cbb-4ef4-8ed1-b92e69066c77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to