diff options
Diffstat (limited to 'deploy_pki')
-rwxr-xr-x | deploy_pki | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 |