Score:0

Transform ansible command to work in Ansible Tower

cn flag

So I am trying to run a playbook from Ansible Tower that I have already successfully run from the command line of an ansible server. However, when trying to run this playbook as a template in Ansible Tower, I get an ssh error saying that the public/rivate key pair does not exist. In order to authenticate to the server, you need to provide the username and password. I was able to do this from this command from the ansible server to successfully run the playbook, by passing the username and prompting for a password to be entered to authenticate to the server.

sudo ansible-playbook ./playbooks/dev/vms-create.yml --user root --ask-pass -i ./inventory/hosts

In Ansible Tower I created an vault password in the credentials section to include the password needed to authenticate to the server. But, I am not able to tell the template to pass the username and password to the server before running the playbook the way I was with the server, with the command that I provided above.

Is there a way that I can include the username and password within the playbook itself? I have an encrypted password file used to pull the password into the main playbook, but I think that I need to pass the credentials to the server before attempting to run the playbook, and I am not sure how to do this through Ansible Tower.

Zeitounator avatar
fr flag
`In Ansible Tower I created an vault password in the credentials section to include the password needed to authenticate to the server` <= If I correctly understand your situation, this is not the correct credential type. You need to create a `machine` credential, enter the username and password in the form and save it, then add it as a cred you want to use in your job template.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.