Per machine credentials for privileges escalation using AWX

100 views
Skip to first unread message

Jonas Hüsser

unread,
Oct 11, 2019, 8:00:03 AM10/11/19
to AWX Project

Hi,


This is a crosspost from https://devops.stackexchange.com/questions/9017/per-machine-credentials-for-privileges-escalation-using-awx because I couldn't get an answer there.


I have an inventory with a lot of hosts in it using the same credentials, but one host needs a different approach. For the ssh connection a different user is used, after the connection is established, we do a privilege escalation with su.

This all works fine when I create a job template in AWX and limit it to this "special" host. But the job template needs to be executed on all hosts. So I want to set the default credentials in the job template, and on this single host I'd like to set the credentials as host variables using

  • ansible_become
  • ansible_user
  • ansible_password
  • ansible_become_method
  • ansible_become_user
  • ansible_become_pass

Of course I don't want the password to be in plain text in AWX so I read something about the vaults. But if I'm understood that correctly, this means I need to create a new credential in AWX and assign it to the job. But that doesn't work for me, because than I can't connect to the other hosts.

Is there a possibility to assign the ansible_become_pass encrypted to this single host?

I know that the easiest way is to use the same credentials as on the other hosts, but unfortunately this is not possible in this case.


Thanks for any help.

Prakash Sharma

unread,
Oct 15, 2019, 11:02:43 PM10/15/19
to AWX Project
If i understood your requirement correctly then i think you need to use custom credential

Jonas Hüsser

unread,
Oct 16, 2019, 10:07:45 AM10/16/19
to AWX Project
Hi Prakash,

Thanks for your input, this looks good, I'll give it a try and post an update here.
Reply all
Reply to author
Forward
0 new messages