aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-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