aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/compile25
1 files changed, 6 insertions, 19 deletions
diff --git a/share/hydra/compile b/share/hydra/compile
index 7fdf195..7167424 100755
--- a/share/hydra/compile
+++ b/share/hydra/compile
@@ -33,30 +33,17 @@ echo "#" >> $CONFIG
echo "# Compiled configuration." >> $CONFIG
echo "# Do not edit this file. Use 'hydra $HYDRA compile' instead." >> $CONFIG
echo "#" >> $CONFIG
-echo "compiled:" >> $CONFIG
-
-#
-# SSH
-#
-echo "Handling SSH keys..."
-echo " ssh:" >> $CONFIG
-
-# Known hosts
-# From facter
-#echo "Processing known_hosts entries..."
-#echo " hosts:" >> $CONFIG
-
-# Authorized keys
-#echo "Processing authorized_keys entries..."
-echo " keys:" >> $CONFIG
+# Process stuff for each node
for node in $NODES; do
# Hiera doesn't accept keys with dots
- key="`echo $node | sed -e 's/\./_/g'`"
+ node_key="`echo $node | sed -e 's/\./_/g'`"
+ # SSH public keys
if [ -e "$HYDRA_FOLDER/keyring/keys/nodes/$node/ssh/id_rsa.pub.asc" ]; then
- echo "... for $node"
+ echo "Adding SSH public key for $node..."
+ key="compiled::ssh::key::$node_key"
value="$(keyringer $HYDRA decrypt nodes/$node/ssh/id_rsa.pub 2> /dev/null)"
- echo " $key: '$value'" >> $CONFIG
+ echo "$key: '$value'" >> $CONFIG
fi
done