I tripped on the following, non consistent problem:
I have a playbook which start like:
`
- name: Clean Data Scylla
hosts: “Scylla”
user: “{{scylla_login}}”
tasks:
…
`
scylla_login is defined in a different file, and for most playbook users this works fine, for other, ssh failed.
When looking into /var/log/secure of the target server, I found:
`
Invalid user {{scylla_login}}
`
Look like the var was not evaluated!
Could this be related to ansible/python/os versio?
Answering my own question, in case some else have similar issue.
scylla_login is defined in inventories/ec2/group_vars/all.yaml
Although I used
`
ansible-playbook -i inventories/ec2/ playbook.yaml
`
The static file was not evaluated, similar to
https://github.com/ansible/ansible/issues/8605
I bypass the issue with
`
ansible-playbook -i inventories/ec2/ -e “@inventories/ec2/group_vars/all.yaml” playbook.yaml
`
It would have been nice if the original have failed, rather than sending the string, including “{{ }}” as a log in.