aboutsummaryrefslogtreecommitdiff
path: root/deploy_pki
diff options
context:
space:
mode:
Diffstat (limited to 'deploy_pki')
-rwxr-xr-xdeploy_pki10
1 files changed, 5 insertions, 5 deletions
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