algo/tests/update-users.sh
Jack Ivanov 35faf4bca7 Local openssl tasks (#169)
* Draft

works with ECDSA

RSA support for Windows

* update-users with local_openssl_tasks

* move prompts to the algo script

* additional directory for SSH keys

* move easyrsa_p12_export_password to pre_tasks

* update-users testing

* Fix hardcoded vars

* Delete the CA key

* Hardcoded IP. Fixes #219

* Some fixes
2017-02-03 14:24:02 -05:00

28 lines
607 B
Bash
Executable File

#!/usr/bin/env bash
set -e
CAPW=`cat /tmp/ca_password`
sed -i 's/- jack$/- jack_test/' config.cfg
ansible-playbook users.yml -e "server_ip=$LXC_IP server_user=root ssh_tunneling_enabled=y IP_subject=$LXC_IP easyrsa_CA_password=$CAPW"
cd configs/$LXC_IP/pki/
if openssl crl -inform pem -noout -text -in crl/jack.crt | grep CRL
then
echo "The CRL check passed"
else
echo "The CRL check failed"
exit 1
fi
if openssl x509 -inform pem -noout -text -in certs/jack_test.crt | grep CN=jack_test
then
echo "The new user exist"
else
echo "The new user does not exist"
exit 1
fi