aboutsummaryrefslogtreecommitdiff
path: root/share/hydra
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-23 14:09:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-23 14:09:52 -0300
commit599ff8f3d71adf5df194f0361c6122a630057a93 (patch)
tree8ae3689319a649b0926c6d373be9857de0e33340 /share/hydra
parent4eb202f0191eb1b6eb558f8f1a6102ca9c6bef9c (diff)
downloadhydra-599ff8f3d71adf5df194f0361c6122a630057a93.tar.gz
hydra-599ff8f3d71adf5df194f0361c6122a630057a93.tar.bz2
Compile: try a flat structure
Diffstat (limited to 'share/hydra')
-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