aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-30 00:29:14 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-30 00:29:14 -0200
commit7f5a53a88d05dfedf64a8234603f3feda75c0cb0 (patch)
treef3a8d544e41a11e2699f8f8880a8348e572d828d /share
parentc1309add8452dea662d87966f497624ecbbce405 (diff)
downloadhydra-7f5a53a88d05dfedf64a8234603f3feda75c0cb0.tar.gz
hydra-7f5a53a88d05dfedf64a8234603f3feda75c0cb0.tar.bz2
Attempt to include sshed25519key and sshecdsakey on compiled config
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/compile36
1 files changed, 30 insertions, 6 deletions
diff --git a/share/hydra/compile b/share/hydra/compile
index 9439f53..e653e3f 100755
--- a/share/hydra/compile
+++ b/share/hydra/compile
@@ -45,18 +45,42 @@ for node in $NODES; do
fi
done
-echo "Compiling stuff from collected facts..."
+echo "Compiling data 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)"
+ rsakey="$(grep sshrsakey: $FACTS/${node}.yaml | cut -d ':' -f 2 | sed -e 's/ //g' -e 's/"//g')"
+ sshed25519key="$(grep sshed25519key: $FACTS/${node}.yaml | cut -d ':' -f 2 | sed -e 's/ //g' -e 's/"//g')"
+ sshecdsakey="$(grep sshecdsakey: $FACTS/${node}.yaml | cut -d ':' -f 2 | sed -e 's/ //g' -e 's/"//g')"
- echo " $node:" >> $CONFIG
- echo " ensure: 'present'" >> $CONFIG
- echo " type : 'ssh-rsa'" >> $CONFIG
- echo " key : '$value'" >> $CONFIG
+ if [ ! -z "$rsakey" ]; then
+ #echo " $node-rsa:" >> $CONFIG
+ echo " $node:" >> $CONFIG
+ #echo " name : '$node'" >> $CONFIG
+ echo " ensure: 'present'" >> $CONFIG
+ echo " type : 'ssh-rsa'" >> $CONFIG
+ echo " key : '$rsakey'" >> $CONFIG
+ fi
+
+ # See [PUP-6589] Resource Type sshkey doesn't allow the declaration of multiple SSH host keys for one host
+ # https://tickets.puppetlabs.com/browse/PUP-6589
+ #if [ ! -z "$sshed25519key" ]; then
+ # echo " $node-sshed25519key:" >> $CONFIG
+ # echo " name : '$node'" >> $CONFIG
+ # echo " ensure: 'present'" >> $CONFIG
+ # echo " type : 'ssh-ed25519'" >> $CONFIG
+ # echo " key : '$sshed25519key'" >> $CONFIG
+ #fi
+
+ #if [ ! -z "$sshecdsakey" ]; then
+ # echo " $node-sshecdsakey:" >> $CONFIG
+ # echo " name : '$node'" >> $CONFIG
+ # echo " ensure: 'present'" >> $CONFIG
+ # echo " type : 'ecdsa-sha2-nistp256'" >> $CONFIG
+ # echo " key : '$sshecdsakey'" >> $CONFIG
+ #fi
fi
done