aboutsummaryrefslogtreecommitdiff
path: root/share/hydra
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-23 16:38:17 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-23 16:38:17 -0300
commit8519a76173341e1fa84d4679c35927495485bb67 (patch)
treef0e7930e4ac7be68d35abc84c7af5dca9a3f4b8e /share/hydra
parentfcaae5e00d76407e806a14e9b19ec148ea6d506c (diff)
downloadhydra-8519a76173341e1fa84d4679c35927495485bb67.tar.gz
hydra-8519a76173341e1fa84d4679c35927495485bb67.tar.bz2
Compile: sshkeys
Diffstat (limited to 'share/hydra')
-rwxr-xr-xshare/hydra/compile18
1 files changed, 17 insertions, 1 deletions
diff --git a/share/hydra/compile b/share/hydra/compile
index eb76f7d..9bd6552 100755
--- a/share/hydra/compile
+++ b/share/hydra/compile
@@ -34,7 +34,7 @@ echo "# Compiled configuration." >> $CONFIG
echo "# Do not edit this file. Use 'hydra $HYDRA compile' instead." >> $CONFIG
echo "#" >> $CONFIG
-# Process stuff for each node
+# Per-node configuration
for node in $NODES; do
# SSH public keys
if [ -e "$KEYS/$node/ssh/id_rsa.pub.asc" ]; then
@@ -44,3 +44,19 @@ for node in $NODES; do
echo "$key: '$value'" >> $CONFIG
fi
done
+
+echo "Compiling stuff from collected facts..."
+
+# SSH known_hosts
+echo "sshkeys:" >> $CONFIG
+
+for node in $NODES; do
+ if [ -e "$FACTS/${node}.yaml" ]; then
+ value="$(grep sshrsakey: $FACTS/${node}.yaml | cut -d '"' -f 2)"
+
+ echo " $node:" >> $CONFIG
+ echo " ensure: 'present'" >> $CONFIG
+ echo " type : 'ssh-rsa'" >> $CONFIG
+ echo " key : '$value'" >> $CONFIG
+ fi
+done