Hi all,

the following task may sound easy but actually it fails all the time ...

I want to store my password in a variable and put it into an ansible-vault 
encrypted file.
The content of this file will look like this:

root_pass_sirius: "{{ TesT1234 }}"

Now my check.yml shall read the encrypted file, get the password and login

- hosts: sirius
  remote_user: ansible
#  gather_facts: no
  become: yes
  become_method: su
     - enc_vars.yml

     ansible_become_pass: '{{ root_pass_sirius }}'

But the login fails with:

FAILED! => {
    "msg": "The field 'become_pass' has an invalid value, which includes an 
undefined variable. The error was: {{ Test1234 }}: 'TesT1234' is 
undefined\nexception type: <class 
'ansible.errors.AnsibleUndefinedVariable'>\nexception: {{ TesT1234 }}: 
'TesT1234' is undefined"

So it looks like ansible is unable to get the variable out of the encrypted 
file ... but WHY ?

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 
For more options, visit https://groups.google.com/d/optout.

Reply via email to