Skip to content

Instantly share code, notes, and snippets.

@frostidaho
Created October 6, 2016 20:50
Show Gist options
  • Save frostidaho/4a88f77dc9b8c8e9314dd099e8a08b21 to your computer and use it in GitHub Desktop.
Save frostidaho/4a88f77dc9b8c8e9314dd099e8a08b21 to your computer and use it in GitHub Desktop.
#!/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