From 7c1444b7143710066f5173119a529c3b5e101300 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 20 Apr 2022 15:03:04 +0200 Subject: Move pki to pass --- deploy_pki | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'deploy_pki') diff --git a/deploy_pki b/deploy_pki index 841088c..8cbd456 100755 --- a/deploy_pki +++ b/deploy_pki @@ -1,13 +1,13 @@ #!/usr/bin/env ./sshtool -PKI=cluster/$CLUSTER/secrets/pki +PKI=deuxfleurs/cluster/$CLUSTER YEAR=$(date +%Y) cmd mkdir -p /var/lib/nomad/pki /var/lib/consul/pki for file in consul-ca.crt consul$YEAR.crt consul$YEAR.key consul$YEAR-client.crt consul$YEAR-client.key; do - if [ -f "$PKI/$file" ]; then - copy_secret $PKI/$file /var/lib/consul/pki/$file + if pass $PKI/$file >/dev/null; then + write_pass $PKI/$file /var/lib/consul/pki/$file cmd chown consul:root /var/lib/consul/pki/$file fi done @@ -16,8 +16,8 @@ cmd systemctl restart consul cmd sleep 10 for file in nomad-ca.crt nomad$YEAR.crt nomad$YEAR.key; do - if [ -f "$PKI/$file" ]; then - copy_secret $PKI/$file /var/lib/nomad/pki/$file + if pass $PKI/$file >/dev/null; then + write_pass $PKI/$file /var/lib/nomad/pki/$file fi done -- cgit v1.2.3