summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-11-21 17:08:22 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-11-21 17:08:22 -0200
commit9851663c1decf9d486e83815f9938ff027309779 (patch)
tree3a49988299e616abb0e25ede4d757cf47a3e79fb
parent0c2968287095adf567f719565627442a6f35ceca (diff)
downloadkeyringer-9851663c1decf9d486e83815f9938ff027309779.tar.gz
keyringer-9851663c1decf9d486e83815f9938ff027309779.tar.bz2
Moving newkeys subcommand to hydra suite
-rwxr-xr-xshare/keyringer/newkeys61
1 files changed, 0 insertions, 61 deletions
diff --git a/share/keyringer/newkeys b/share/keyringer/newkeys
deleted file mode 100755
index 84d1c27..0000000
--- a/share/keyringer/newkeys
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-#
-# Create keys for new nodes.
-#
-
-function newkeys_nodes {
- # See http://www.mail-archive.com/puppet-users@googlegroups.com/msg01615.html
- grep ^node $* | sed -e 's/^node //' | awk -F, '{for(i=1;i<=NF;i++) {print $i}}' | cut -d "'" -f2
-}
-
-function newkeys_puppet {
- # Generates ssh and gpg keys for new nodes
- # GPG keys should be manually imported in the nodes
-
- if [ -e "$PUPPET/manifests/nodes.pp" ]; then
- nodes="`newkeys_nodes $PUPPET/manifests/nodes.pp`"
- fi
-
- if [ -d "$PUPPET/manifests/nodes" ]; then
- nodes="$nodes `newkeys_nodes $PUPPET/manifests/nodes/*`"
- fi
-
- for host in $nodes; do
- node="`echo $host | cut -d . -f 1`"
- privkey="$PUPPET_KEYS/"$node"_id_dsa"
- pubkey="$privkey.pub"
- if [ ! -e "$privkey" ] || [ ! -e "$pubkey" ]; then
- keyringer_exec genpair $BASEDIR ssh $node/ssh/id_dsa $host $privkey
- keyringer_exec genpair $BASEDIR gpg $node/gpg/key $host
-
- # Add key into puppet git repository
- ( cd $PUPPET_KEYS && git add $privkey $pubkey )
- fi
- done
-}
-
-# Load functions
-LIB="`dirname $0`/../../lib/keyringer"
-source $LIB/functions || exit 1
-
-# Command parser
-keyringer_get_command $2
-
-source $OPTIONS
-keyringer_config_load_preferences
-
-if [ -z "$PUPPET" ]; then
- "Error: you have to setup PUPPET path at your preferences for this keyring."
-fi
-
-if [ -z "$PUPPET_KEYS" ]; then
- PUPPET_KEYS="$PUPPET/files/keys"
-fi
-
-# Right now just puppet backend is supported
-if [ "$COMMAND" == "puppet" ]; then
- newkeys_puppet
-else
- echo "No such option $COMMAND"
- exit 1
-fi