You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
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.
Cody Harlow
unread,
Feb 22, 2018, 6:56:18 PM2/22/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
I should mention that I call the variable using hostvars['localhost']['varname']['json']['password'].
Kai Stian Olstad
unread,
Feb 23, 2018, 9:25:59 AM2/23/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
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
Message has been deleted
Cody Harlow
unread,
Feb 23, 2018, 12:28:55 PM2/23/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
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?