Re: [ansible-project] Using new SSH password when running task

2018-02-23 Thread Cody Harlow
So I guess this turns into a question of can I start a new SSH connection 
with a new password and user when it runs a new play?

On Friday, February 23, 2018 at 9:25:59 AM UTC-5, Kai Stian Olstad wrote:
>
> On Friday, 23 February 2018 00.54.31 CET Cody Harlow wrote: 
> > So I have a role that pulls a password from a website using the uri 
> method 
> > and I store it in a variable. I call the variable like this: 
> > varname.json.password. How can I use this password when Ansible jumps to 
> > the next play? I tried setting ansible_user and ansible_ssh_pass as 
> > variables, and I can see it change the user but it always rejects the 
> > password. Am I missing something simple, or can this not be done? I've 
> hard 
> > coded the password and it's worked before but it appears when I try to 
> call 
> > the variable, something isn't passing properly. 
>
> Without the code there is very little we can help with. 
>
> Variables in Ansible are global and are available between play in the same 
> playbook. 
> To get variable from another host you would need to use hostvars. 
>
>
> -- 
> Kai Stian Olstad 
>

-- 
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/5f11d661-fc6d-4d10-8da4-41386ed60e8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Using new SSH password when running task

2018-02-23 Thread Cody Harlow
So I guess this turns into a question of can I start a new SSH connection 
when it runs a new play?

On Friday, February 23, 2018 at 9:25:59 AM UTC-5, Kai Stian Olstad wrote:
>
> On Friday, 23 February 2018 00.54.31 CET Cody Harlow wrote: 
> > So I have a role that pulls a password from a website using the uri 
> method 
> > and I store it in a variable. I call the variable like this: 
> > varname.json.password. How can I use this password when Ansible jumps to 
> > the next play? I tried setting ansible_user and ansible_ssh_pass as 
> > variables, and I can see it change the user but it always rejects the 
> > password. Am I missing something simple, or can this not be done? I've 
> hard 
> > coded the password and it's worked before but it appears when I try to 
> call 
> > the variable, something isn't passing properly. 
>
> Without the code there is very little we can help with. 
>
> Variables in Ansible are global and are available between play in the same 
> playbook. 
> To get variable from another host you would need to use hostvars. 
>
>
> -- 
> Kai Stian Olstad 
>

-- 
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/d21a25da-9db2-4a0b-95bb-9adaa890ee08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Using new SSH password when running task

2018-02-23 Thread Kai Stian Olstad
On Friday, 23 February 2018 00.54.31 CET Cody Harlow wrote:
> So I have a role that pulls a password from a website using the uri method 
> and I store it in a variable. I call the variable like this: 
> varname.json.password. How can I use this password when Ansible jumps to 
> the next play? I tried setting ansible_user and ansible_ssh_pass as 
> variables, and I can see it change the user but it always rejects the 
> password. Am I missing something simple, or can this not be done? I've hard 
> coded the password and it's worked before but it appears when I try to call 
> the variable, something isn't passing properly. 

Without the code there is very little we can help with.

Variables in Ansible are global and are available between play in the same 
playbook.
To get variable from another host you would need to use hostvars.


-- 
Kai Stian Olstad

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


[ansible-project] Using new SSH password when running task

2018-02-22 Thread Cody Harlow
So I have a role that pulls a password from a website using the uri method 
and I store it in a variable. I call the variable like this: 
varname.json.password. How can I use this password when Ansible jumps to 
the next play? I tried setting ansible_user and ansible_ssh_pass as 
variables, and I can see it change the user but it always rejects the 
password. Am I missing something simple, or can this not be done? I've hard 
coded the password and it's worked before but it appears when I try to call 
the variable, something isn't passing properly. 

-- 
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/22de22df-2d09-457f-b10a-469756ea1486%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.