Initial version of playbook which creates virtual machines.

This commit is contained in:
Timo Makinen 2019-05-10 10:26:27 +03:00
commit b010f9db84
4 changed files with 191 additions and 0 deletions

24
scripts/getpasswd Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: $(basename "$0") <hostname>" 1>&2
exit 1
fi
TARGET=$1
ENC=/srv/ansible-private/keystore/${TARGET}.asc
KEY=/srv/ansible-private/ssh/id_rsa
if [ ! -f "${KEY}" ]; then
echo "ERR: Cannot find encryption key file ${KEY}" 1>&2
exit 1
fi
if [ ! -f "${ENC}" ]; then
echo "ERR: Cannot find password entry for ${TARGET}" 1>&2
exit 1
fi
base64 -d "${ENC}" | openssl rsautl -decrypt -raw -inkey "${KEY}"
echo