Using multiple SSH keys in a template

226 views
Skip to first unread message

Christian Garling

unread,
Jul 14, 2023, 8:03:31 AM7/14/23
to AWX Project
Hi folks,

I need to use two different SSH keys in a template to access all hosts in my inventory.

I followed these howto:


And also this one:


But nothing worked for me. Maybe all of these howto rely on an older version of AWX before it moved to Kubernetes.

Is there any way to have multiple SSH keys in a single template that works with recent AWX versions?

Kind regards, Christian

AWX Project

unread,
Jul 14, 2023, 2:15:30 PM7/14/23
to AWX Project
that first link guide should still be relevant for newer version of AWX running on k8s.

Can you provide the exact error message you are getting when running the jobs?

AWX Team

Christian Garling

unread,
Jul 17, 2023, 5:34:49 AM7/17/23
to AWX Project
Hi AWX Team,

I will try to explain it all in detail.

I have an inventory with 64 hosts. 61 of them work with the standard SSH key, the other 3 hosts need a second key, because they are older and do not understand the cryptographics that will be used with the other key.
So I created a second key, that needs to be used explicitly when I connect to these 3 hosts.

My configuration is as followed (I followed the RHEL knowledge base article):

awx-multi-ssh1.png

awx-multi-ssh2.png

awx-multi-ssh3.png

awx-multi-ssh4.png

Inside the template:

awx-multi-ssh5.png
And finally in the Variables of one of the hosts:

awx-multi-ssh6.png

The error message I receive:

awx-multi-ssh7.png

I also tried the SSH keys directly in the awx-ee container:

bash-5.1$ ssh -i key1.pem ansible_deploy@nfszvweb1
ansible_deploy@nfszvweb1's password:

bash-5.1$ ssh -i key2.pem ansible_deploy@nfszvweb1
Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-51-generic x86_64)

Where key1.pem is the standard SSH key I enrolled on all hosts and key2.pem is the second key to workaround the 3 older hosts.

For me it looks like, that the second SSH key will not be used within the template run.

Regards, Christian

Christian Garling

unread,
Jul 24, 2023, 2:25:11 AM7/24/23
to AWX Project
Hi together,

any news here? Did I make a mistake in the configuration?

Regards, Christian

Reply all
Reply to author
Forward
0 new messages