diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-05-12 12:00:01 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-05-12 12:00:01 -0300 |
commit | 26b9c978cbae93a5a083c40eb3c53567a5c7a292 (patch) | |
tree | 19f0af01b4c101e1d4f011fdc3fcc3d243dc5542 | |
parent | ecab72cd456e7c526a0ce2ef902187d61a7279ee (diff) | |
download | hydra-26b9c978cbae93a5a083c40eb3c53567a5c7a292.tar.gz hydra-26b9c978cbae93a5a083c40eb3c53567a5c7a292.tar.bz2 |
Deploy: copy hiera-eyaml keys
-rw-r--r-- | TODO.md | 2 | ||||
-rw-r--r-- | lib/hydra/deploy | 19 | ||||
-rwxr-xr-x | share/hydra/deploy | 6 |
3 files changed, 26 insertions, 1 deletions
@@ -11,7 +11,7 @@ Hydra - init: version control in the superproject? - deploy: - lockfile. - - keys, certs and secrets. + - keys and certs. - fix /etc/puppet permissions. - check hostname and required node configuration. - log applied version and date (in the node and also in the repo?). diff --git a/lib/hydra/deploy b/lib/hydra/deploy index 26c28d0..4c6d967 100644 --- a/lib/hydra/deploy +++ b/lib/hydra/deploy @@ -110,6 +110,25 @@ function hydra_deploy_mkdirs { $DEPLOY_COMMAND chmod -R 640 /etc/puppet } +# Copy keys +function hydra_deploy_copy_keys { + local location="$1" + + if [ -z "$location" ]; then + location="remote" + fi + + $DEPLOY_COMMAND mkdir -p $FOLDER/etc/puppet/keys + + if [ -e "$HYDRA_FOLDER/puppet/keys/private_key.pkcs7.pem" ]; then + hydra_deploy_copy $location $HYDRA_FOLDER/puppet/keys/private_key.pkcs7.pem $DEPLOY_DEST/etc/puppet/keys/private_key.pkcs7.pem + fi + + if [ -e "$HYDRA_FOLDER/puppet/keys/public_key.pkcs7.pem" ]; then + hydra_deploy_copy $location $HYDRA_FOLDER/puppet/keys/public_key.pkcs7.pem $DEPLOY_DEST/etc/puppet/keys/public_key.pkcs7.pem + fi +} + # Copy config secrets function hydra_deploy_copy_secrets { local location="$1" diff --git a/share/hydra/deploy b/share/hydra/deploy index 1321a06..1307802 100755 --- a/share/hydra/deploy +++ b/share/hydra/deploy @@ -65,6 +65,9 @@ for node in $NODES; do echo "Syncing configuration..." $DEPLOY_RSYNC "$RSYNC_PATH" $DEPLOY_OPTS + # Copy keys + hydra_deploy_copy_keys folder + # Copy config configuration hydra_deploy_copy_secrets folder @@ -110,6 +113,9 @@ EOF echo "Syncing configuration..." $DEPLOY_RSYNC "$RSYNC_PATH" $DEPLOY_OPTS + # Copy keys + hydra_deploy_copy_keys remote + # Copy configuration hydra_deploy_copy_secrets remote |