diff options
Diffstat (limited to 'deploy_pki')
-rwxr-xr-x | deploy_pki | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -19,10 +19,10 @@ cmd ln -sf /var/lib/consul/pki/consul$YEAR.key /var/lib/consul/pki/consul.key cmd ln -sf /var/lib/consul/pki/consul$YEAR-client.crt /var/lib/consul/pki/consul-client.crt cmd ln -sf /var/lib/consul/pki/consul$YEAR-client.key /var/lib/consul/pki/consul-client.key -if [ ! "$CLUSTER" = "prod" ]; then - cmd systemctl restart consul - cmd sleep 10 -fi + +cmd systemctl reload consul +cmd sleep 10 + for file in nomad-ca.crt nomad$YEAR.crt nomad$YEAR.key \ nomad$YEAR-client.crt nomad$YEAR-client.key \ @@ -30,7 +30,9 @@ for file in nomad-ca.crt nomad$YEAR.crt nomad$YEAR.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" + if [ "$CLUSTER" = "prod" ]; then + cmd "chown \$(stat -c %u /var/lib/private/nomad/) /var/lib/nomad/pki/$file" + fi fi done @@ -42,9 +44,7 @@ cmd ln -sf /var/lib/nomad/pki/consul$YEAR.crt /var/lib/nomad/pki/consul.crt cmd ln -sf /var/lib/nomad/pki/consul$YEAR-client.crt /var/lib/nomad/pki/consul-client.crt cmd ln -sf /var/lib/nomad/pki/consul$YEAR-client.key /var/lib/nomad/pki/consul-client.key -if [ ! "$CLUSTER" = "prod" ]; then - cmd systemctl restart nomad -fi +cmd systemctl reload nomad set_env CONSUL_HTTP_ADDR=https://localhost:8501 set_env CONSUL_CACERT=/var/lib/consul/pki/consul-ca.crt |