aboutsummaryrefslogtreecommitdiff
path: root/deploy_pki
diff options
context:
space:
mode:
Diffstat (limited to 'deploy_pki')
-rwxr-xr-xdeploy_pki9
1 files changed, 7 insertions, 2 deletions
diff --git a/deploy_pki b/deploy_pki
index 8cbd456..167ac50 100755
--- a/deploy_pki
+++ b/deploy_pki
@@ -5,7 +5,9 @@ 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
+for file in consul-ca.crt consul$YEAR.crt consul$YEAR.key \
+ consul$YEAR-client.crt consul$YEAR-client.key
+do
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
@@ -15,9 +17,12 @@ done
cmd systemctl restart consul
cmd sleep 10
-for file in nomad-ca.crt nomad$YEAR.crt nomad$YEAR.key; do
+for file in nomad-ca.crt nomad$YEAR.crt nomad$YEAR.key \
+ consul$YEAR.crt consul$YEAR-client.crt consul$YEAR-client.key
+do
if pass $PKI/$file >/dev/null; then
write_pass $PKI/$file /var/lib/nomad/pki/$file
+ cmd "chown \$(stat -c %u /var/lib/private/nomad) /var/lib/nomad/pki/$file"
fi
done