blob: cb585871b6f3b6318ddf918e882807945e04246c [file] [log] [blame]
Ales Komarek1b373112017-08-08 08:48:56 +02001#!/bin/bash
2
3# Prints commands to create user .yml with linux/openssh pillar
4# $1 - csv file with full name; email; id; ssh pub key
5
6awk -F';' '\
7 { fname=$1;gsub(/\s+/,_,$1); sname=tolower(substr($1,1,1)substr($1,index(fname," "))); split($4, key ," "); }
Petr Michalecf111cf92018-05-30 17:01:25 +02008 { print "FNAME=\""fname"\"", "SNAME=\""sname"\"", "KEY=\""key[1]" "key[2]"\"","EMAIL="$2" envsubst < team.template > "tolower($1)".yml" }'\
9 < $1