From c39581b7054cfd755c63ed1803d31134196009d8 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 12 May 2016 19:06:40 -0300 Subject: Ensure eyaml key availability --- lib/hydra/deploy | 10 +++++++++- share/hydra/deploy | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/hydra/deploy b/lib/hydra/deploy index ed41d08..2cff22b 100644 --- a/lib/hydra/deploy +++ b/lib/hydra/deploy @@ -58,6 +58,13 @@ function hydra_deploy_setup { FQDN="`cat /etc/hostname`" PUPPET_OPTS="--confdir=$HYDRA_FOLDER/puppet --modulepath=$HYDRA_FOLDER/puppet/modules" hydra_deploy_set_manifest $HYDRA_FOLDER + + # Fix eyaml keys + mkdir -p $HYDRA_FOLDER/puppet/keys + rm -f $HYDRA_FOLDER/puppet/keys/private_key.pkcs7.pem + rm -f $HYDRA_FOLDER/puppet/keys/public_key.pkcs7.pem + ln -sf $HYDRA_FOLDER/puppet/keys/$FQDN/eyaml/private_key.pkcs7.pem $HYDRA_FOLDER/puppet/keys/private_key.pkcs7.pem + ln -sf $HYDRA_FOLDER/puppet/keys/$FQDN/eyaml/public_key.pkcs7.pem $HYDRA_FOLDER/puppet/keys/public_key.pkcs7.pem fi # Common parameters @@ -118,7 +125,8 @@ function hydra_deploy_copy_keys { location="remote" fi - $DEPLOY_COMMAND mkdir -p $FOLDER/etc/puppet/keys + # Ensure key availability + hydra $HYDRA eyaml $FQDN if [ -e "$HYDRA_FOLDER/puppet/keys/$FQDN/eyaml/private_key.pkcs7.pem" ]; then hydra_deploy_copy $location $HYDRA_FOLDER/puppet/keys/$FQDN/eyaml/private_key.pkcs7.pem $DEPLOY_DEST/etc/puppet/keys/private_key.pkcs7.pem diff --git a/share/hydra/deploy b/share/hydra/deploy index 1307802..f8dbb08 100755 --- a/share/hydra/deploy +++ b/share/hydra/deploy @@ -80,6 +80,9 @@ for node in $NODES; do # Setup deploy environment hydra_deploy_setup + # Ensure key availability + hydra $HYDRA eyaml $FQDN + # Check if puppet is installed if [ ! -e "/usr/bin/puppet" ]; then $SUDO apt-get update -- cgit v1.2.3