blob: cb585871b6f3b6318ddf918e882807945e04246c [file] [log] [blame]
#!/bin/bash
# Prints commands to create user .yml with linux/openssh pillar
# $1 - csv file with full name; email; id; ssh pub key
awk -F';' '\
{ fname=$1;gsub(/\s+/,_,$1); sname=tolower(substr($1,1,1)substr($1,index(fname," "))); split($4, key ," "); }
{ print "FNAME=\""fname"\"", "SNAME=\""sname"\"", "KEY=\""key[1]" "key[2]"\"","EMAIL="$2" envsubst < team.template > "tolower($1)".yml" }'\
< $1