From: David Galloway Date: Fri, 1 Sep 2017 19:18:29 +0000 (-0400) Subject: tools: Script to simplify Cobbler user creation X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ffa17f41fb59d7388e67bb41e6c609b806059ddf;p=ceph-cm-ansible.git tools: Script to simplify Cobbler user creation Signed-off-by: David Galloway --- diff --git a/tools/cobbler-access.sh b/tools/cobbler-access.sh new file mode 100755 index 00000000..1dca738c --- /dev/null +++ b/tools/cobbler-access.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Script to generate Cobbler credentials + +tmpfile=$(mktemp) + +# Basically `mkpasswd` but uses a small subset of special characters +password=$(head /dev/urandom | tr -dc 'A-Za-z0-9!@#$%&' | head -c 12 && echo) + +if [ $# -eq 0 ]; then + printf "Enter username: " + read -r username +else + username=$1 +fi + +cat << EOF + +------ String for cobbler.yml ------ +$(echo -n "$username:Cobbler:" && echo -n "$username:Cobbler:$password" | md5sum | awk '{ print $1 }') + +------ E-mail to $username ------ +Hi FIRSTNAME, + +Here are your Cobbler user credentials. + +Username: $username +Password: $password + +Please do not share these credentials. + +Thank you. + +EOF