File tree Expand file tree Collapse file tree
ansible/roles/docker_client/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77echo ' WARN: hard coded alpha-api-old gamma-services and beta-services for SWARM'
88if [[ $2 = ' ' ]]; then
9- echo ' script requires a client ip address'
10- exit 1
11- fi
12-
13- if [[ $3 = ' ' ]]; then
149 echo ' script requires a path for secrets'
1510 exit 1
1611fi
1712
18- CERT_PATH=$3
13+ CERT_PATH=$2
1914if [ ! -d " $CERT_PATH " ]; then
2015 echo ' The specified directory for certs does not exist'
2116fi
@@ -37,12 +32,12 @@ openssl req \
3732chmod 400 " $CLIENT /client.csr"
3833
3934echo extendedKeyUsage=clientAuth,serverAuth > " $CLIENT /extfile.cnf"
40- echo subjectAltName=IP:$2 >> " $CLIENT /extfile.cnf"
35+ echo subjectAltName=IP:IP:127.0.0.1,DNS:localhost,DNS:swarm >> " $CLIENT /extfile.cnf"
4136
4237# generate cert for client
4338openssl x509 \
4439 -req \
45- -days 365 \
40+ -days 3650 \
4641 -sha256 \
4742 -in " $CLIENT /client.csr" \
4843 -CA $CERT_PATH /ca.pem \
@@ -58,4 +53,4 @@ chmod 644 "$CLIENT/key.pem"
5853
5954# cleanup files we do not need
6055rm $CLIENT /extfile.cnf
61- rm -f $CLIENT /client.csr
56+ rm $CLIENT /client.csr
You can’t perform that action at this time.
0 commit comments