Created
October 6, 2016 20:50
-
-
Save frostidaho/4a88f77dc9b8c8e9314dd099e8a08b21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
set -e -E # -e --> exit on err; -E --> print error trace | |
user="$1" | |
risna () { | |
playbook="$1" | |
user="$2" | |
rest="${@:3}" | |
isna $playbook -e username $user -u root,sudo,no $rest | |
} | |
if [ -z "$user" ]; then | |
echo "Must pass argument: user" | |
exit 1 | |
fi | |
risna user-create.yml $user | |
risna copy-ssh-key.yml $user -e keypath ~/.ssh/id_rsa | |
risna copy-ssh-key.yml $user -e keypath ~/.ssh/id_rsa.1 | |
risna add-auth-key.yml $user -e keypath_pub ~/.ssh/id_rsa.pub | |
risna add-auth-key.yml $user -e keypath_pub ~/.ssh/id_rsa.1.pub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment