Re: [ansible-project] Howto read variables from an vaut encrypted file

2018-03-19 Thread Michael-John Turner

On Wed, Mar 07, 2018 at 09:07:53PM +, neccro...@gmail.com wrote:
So it looks like ansible is unable to get the variable out of the 
encrypted

file ... but WHY ?


Brian provided a clue in his answer, but to make it more explicit: 
root_pass_sirius is not correctly declared. 


Instead of:
root_pass_sirius: "{{ TesT1234 }}"
it should be:
root_pass_sirius: "TesT1234"

You want the password to have the value "TesT1234" - in the incorrect 
declaration, it's being set to the value of a variable called TesT1234, 
which doesn't exist. Remove the {{ }} and it'll work.


Cheers, MJ
--
Michael-John Turner * m...@mjturner.net * http://mjturner.net/ 


--
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 
https://groups.google.com/d/msgid/ansible-project/20180308081840.sibwxjthxoi36vgl%40saucer.turnde.net.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Howto read variables from an vaut encrypted file

2018-03-08 Thread Richard Sobey
My limited understanding is that this:

root_pass_sirius: "{{ TesT1234 }}"

..is definting another variable called "TesT1234" rather than assigning the
literal "TesT1234" to the variable "root_pass_sirius" like:

root_pass_sirius: "TesT1234"

On 8 March 2018 at 06:06,  wrote:

> Hi Brian,
>
> of course not. it's supposed to be the value of 'root_pass_sirus' ...
>
> Am Donnerstag, 8. März 2018 01:13:24 UTC+1 schrieb Brian Coca:
>>
>> Ansilbe reads the 'root_pass_sirus' variable fine, the problem is that
>> 'TesT1234' variable isn't defined anywhere.
>>
>>
>> --
>> --
>> Brian Coca
>>
> --
> 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 https://groups.google.com/d/
> msgid/ansible-project/fb17c895-772f-4e03-a8fe-dc41cdf7b8e2%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 
https://groups.google.com/d/msgid/ansible-project/CAAkoFG%3DMC_7GeEiXBDiBHYSsgHQmuKrvSZdWT1aJPP0fQ5M0Ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Howto read variables from an vaut encrypted file

2018-03-07 Thread neccross9
Hi Brian,

of course not. it's supposed to be the value of 'root_pass_sirus' ...

Am Donnerstag, 8. März 2018 01:13:24 UTC+1 schrieb Brian Coca:
>
> Ansilbe reads the 'root_pass_sirus' variable fine, the problem is that 
> 'TesT1234' variable isn't defined anywhere. 
>
>
> -- 
> -- 
> Brian Coca 
>

-- 
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 
https://groups.google.com/d/msgid/ansible-project/fb17c895-772f-4e03-a8fe-dc41cdf7b8e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Howto read variables from an vaut encrypted file

2018-03-07 Thread Brian Coca
Ansilbe reads the 'root_pass_sirus' variable fine, the problem is that
'TesT1234' variable isn't defined anywhere.


-- 
--
Brian Coca

-- 
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 
https://groups.google.com/d/msgid/ansible-project/CACVha7ca0zQh0m5L6bF31gh-sriqvbMAMYarPgotY_P8CZ0peA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Howto read variables from an vaut encrypted file

2018-03-07 Thread neccross9
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
  vars_files:
 - enc_vars.yml

  vars:
 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: \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 
https://groups.google.com/d/msgid/ansible-project/d71c7596-d7d4-435f-a4dd-dbec7ed369e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.