Send vcenter Admin username\password to AWX


#1

I’m new to ManageIQ , I have a AnsibleTower Catalog item that builds a vm using the VMware_guest module .
I don’t want to hardcode vcenter credentials in the service dialog.
I figured out how to get vcenter, username, & user password, but I cant figure out how to set as param that gets pickup by the AnsibleTower job.
I hope I’m making sense


#2

We do not use Ansible Tower ourselfs, but if you are using standalone Tower/AWX I would guess that Tower needs to provide the credentials for the Playbook

If you are running Embedded Ansible (a ManageIQ Feature) this should help:
https://manageiq.gitbook.io/mastering-cloudforms-automation-addendum/embedded_ansible/chapter-8


#3

Thanks for the reply ,
I read it but it pertains to embedded ansible.
I’m trying to find a way to pass:
vc = $evm.vmdb(:ExtManagementSystem).find_by(:type=>“ManageIQ::Providers::Vmware::InfraManager”)

userid = vc.authentication_userid

password = vc.authentication_password

to AWX job template param without having to have it hardcoded in the service dialog


#4

Correct me if I am wrong, but I don’t think you should have to pass the credentials from ManageIQ to Tower. Instead you should create the credentials in Tower and configure the Job Template in Tower to use them.

From Towers point of view, ManageIQ should be like any other (API) User and should not have to provide any credentials, since credential management is one of its features.


#5

I think I explained it wrong.
what I’m trying to do is use the credentials in a playbook. I could create a Custom Credential Type in AWX and use that in the playbook, but than that would be another place to update the password when it changes. We change all our passwords every 60 days.
I want to pass the vcenter credentials from miq to a Service Dialog that I’m using with a “Ansible Tower” catalog so it can be used in the play book like a service dialog_param gets passed to a playbook


#6

Now I see the Problem.

You can try this ansible role: https://github.com/syncrou/manageiq-automate
The connection details for ManageIQs API should be passed to the Playbook by ManageIQ.