SSH Public key synchonization acros several servers, how to automate it?


Hello,

im working on a script which will allow several folders synchronization acros multiple servers.
On each server the script will download data from rest of the servers via rsync via ssh (rsync have archive and update attribute).
For this transfer ssh public access key is needed.

When i add new server to the group, i need to:
1) run ssh-keygen on new server and via ssh-copy-id add key it to rest of servers so i can download data from them…
2) do the same on all old servers so each of…

SSH Public key synchonization acros several servers, how to automate it?