Hi Ankit, Thanks for your reply. My question is whether can we use Ansible tower credentials in the playbook or not? I have experienced in using the tower credentials in the job template. Is there anyway to use the credentials inside playbook to store the username/ password as part of the play execution? Regards Saravanan
On Mon, Jan 28, 2019 at 1:16 AM Ankit Vashistha <[email protected]> wrote: > The question should be posted in AWX group or instead should be posted for > your Red-hat support. > > Coming to your question, you don't need to specifically define the > username and password in the playbook. When you create a template, you > choose the playbook, credentials (already created ones under credentials > section of Ansible Tower) and other attributes for that particular > template. Not sure what you are trying to achieve by trying to print the > credentials though. > > *Thanks and Regards,* > > *Ankit Kumar Sharma* > > On Mon, Jan 28, 2019 at 7:37 AM Saravanan <[email protected]> wrote: > >> Hi Ansible Experts, >> This question is more relevant to Ansible Tower. >> Can someone help to read the Ansible tower credentials in Playbook? >> We have created machine type credential called *sampleCredential* and >> password for it. Now how do I use them in the playbook >> >> --- >> - hosts: all >> >> vars: >> machine: >> username: '{{ sampleCredential }}' >> password: '{{ sampleCredential }}' >> >> tasks: >> - debug: >> var: machine >> >> Using this playbook, unable to retrieve the machine credential value in >> the playbook. Any help on this request much appreciated. >> >> Regards >> Saravanan >> >> >> >> -- >> 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 [email protected]. >> To post to this group, send email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/1f25d6d0-bab6-419c-a8c9-b571969e54f5%40googlegroups.com >> <https://groups.google.com/d/msgid/ansible-project/1f25d6d0-bab6-419c-a8c9-b571969e54f5%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/CACecUhuG1u360b0PwuKs_%3D3%2Bh72JTfT2Lu70kWRngR7NwvRz5A%40mail.gmail.com > <https://groups.google.com/d/msgid/ansible-project/CACecUhuG1u360b0PwuKs_%3D3%2Bh72JTfT2Lu70kWRngR7NwvRz5A%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAMLxZaPJsvCSXbTCC%2BiED4CGbvgSGaeVstJ72syXCQF688XOeA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
