user parameter is not evaluated, failing the ssh

9 views
Skip to first unread message

Tzach Livyatan

unread,
Apr 10, 2016, 2:52:11 PM4/10/16
to Ansible Project
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?

Tzach Livyatan

unread,
Apr 10, 2016, 3:31:52 PM4/10/16
to Ansible Project
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

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.
Reply all
Reply to author
Forward
0 new messages