misc: add script to copy SSH keys

This one has the advantage of actually working :)
I had to blacklist some hosts because they would either outright refuse
connections or would refuse my LDAP credentials.
pull/1/head
Yohaï-Eliel BERREBY 4 years ago
parent a77b2c4f0f
commit 29991141f5

1
.gitignore vendored

@ -1 +1,2 @@
*.retry
ldap-password.txt

@ -0,0 +1,17 @@
#!/bin/bash
set -e
# Grab valid unique hostnames from the Ansible inventory.
HOSTS=$(grep -ve '^[#\[]' hosts \
| grep -ve '^$' \
| grep -F adm.auro.re \
| grep -vf ssh-blacklist.txt \
| sort -u)
for host in $HOSTS; do
echo "Handling host $host"
# sshpass can be used for non-interactive password authentication.
# place your password in ldap-password.txt.
sshpass -f ldap-password.txt ssh-copy-id "$host"
done

@ -0,0 +1,4 @@
ldap-replica-edc-backup.adm.auro.re
ldap-replica-fleming-backup.adm.auro.re
ldap-replica-gs.adm.auro.re
ldap-replica-gs-backup.adm.auro.re
Loading…
Cancel
Save