Using multiple SSH keys in a template

Hi folks,

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

I followed these howto:

How to useSSH Keys for Multiple Credentials In Ansible Tower? - Red Hat Customer Portal

And also this one:

How to manage multiple private keys in AWX (google.com)

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

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

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):

Inside the template:

awx-multi-ssh5.png

And finally in the Variables of one of the hosts:

The error message I receive:

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

Hi together,

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

Regards, Christian