From 599ff8f3d71adf5df194f0361c6122a630057a93 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 23 Jun 2016 14:09:52 -0300 Subject: Compile: try a flat structure --- share/hydra/compile | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'share/hydra/compile') 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 -- cgit v1.2.3