diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-09-08 18:50:09 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-09-08 18:50:09 +0200 |
commit | 4d6a0f553ae4cbdeec73dffe4aabb3110c0e09c0 (patch) | |
tree | 2283c968c58e3ea61f3abf58c10e08662087a140 /ansible/make-ssh-keys | |
parent | c1fe8d9551e337031e5a5d62224779b389872ea3 (diff) | |
download | infra-4d6a0f553ae4cbdeec73dffe4aabb3110c0e09c0.tar.gz infra-4d6a0f553ae4cbdeec73dffe4aabb3110c0e09c0.tar.bz2 infra-4d6a0f553ae4cbdeec73dffe4aabb3110c0e09c0.tar.xz infra-4d6a0f553ae4cbdeec73dffe4aabb3110c0e09c0.zip |
o Borg wip.
Diffstat (limited to 'ansible/make-ssh-keys')
-rwxr-xr-x | ansible/make-ssh-keys | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ansible/make-ssh-keys b/ansible/make-ssh-keys new file mode 100755 index 0000000..fbf2b7a --- /dev/null +++ b/ansible/make-ssh-keys @@ -0,0 +1,24 @@ +#!/bin/bash + +set -euo pipefail + +hosts=(conflatorio birgitte arius) + +rm -rf keys +mkdir keys + +out=/dev/stderr +out=keys/keys.yml + +echo borg_ssh_keys: >> $out +for host in ${hosts[@]} +do + ssh-keygen -q -t ed25519 -N "" -C "borg/$host" -f keys/$host + echo " $host:" >> $out + echo " public: $(<keys/$host.pub)" >> $out + echo " private: |" >> $out + sed "s/^/ /" keys/$host >> $out +done + +ansible-vault encrypt --output group_vars/all/borg_ssh_keys.yml keys/keys.yml +rm -rf keys |