algo/algo
2016-08-16 00:03:26 -04:00

45 lines
845 B
Bash
Executable file

#!/bin/sh
p12_export_password () {
echo -n "
Enter the password for p12 certificates (default: vpn):
: "
read -s P
P=${P:-vpn}
}
algo_provisioning () {
echo -n "
What provider would you like to use?
1. DigitalOcean
2. Amazon EC2
3. Google Compute Engine
4. Remote installation (install to existing Ubuntu server)
Enter the number of your desired provider
: "
read N
case "$N" in
1) CLOUD="digitalocean" ;;
2) CLOUD="ec2" ;;
3) CLOUD="gce" ;;
4) CLOUD="non-cloud" ;;
*) exit 1 ;;
esac
p12_export_password
ansible-playbook "${CLOUD}.yml" -e easyrsa_p12_export_password=${P}
}
user_management () {
p12_export_password
ansible-playbook users.yml -e easyrsa_p12_export_password=${P}
}
case "$1" in
update-users) user_management ;;
*) algo_provisioning ;;
esac