How to automate key distribution prior to Ansible being deployed?
0
votes
1
answer
39
views
How do admins typically distribute Ansible .pub keys to clients in an early environment? Do they just script that can run
ssh-copy-id
to multiple machines?
I've looked at other forums and users said to use Ansible to distribute keys, but how can you distribute keys if there's not already one on the client? (I'm not that deep into Ansible, I'm just trying to connect the dots)
EDIT:
I created a inventory file for my lab environment called "inv.ini".
Running the command ansible -i inv.ini clients -m ping
shot back "Permission Denied" errors for each client within the group. I used ssh-keygen
to generate a RSA key for my admin account, and copied them to each client (manually). After this, the above command worked.
Asked by Ambre
(111 rep)
Nov 20, 2024, 01:49 PM
Last activity: May 1, 2025, 05:36 PM
Last activity: May 1, 2025, 05:36 PM