Initial commit
diff --git a/teams/README.rst b/teams/README.rst
new file mode 100644
index 0000000..98a6a16
--- /dev/null
+++ b/teams/README.rst
@@ -0,0 +1,21 @@
+
+============================================
+Generate a team accounts from CSV input file
+============================================
+
+Modify team.sh in order to properly parse your input file.
+Example usage to generate individuals yaml configs:
+
+.. code-block:: bash
+
+ ./team.sh team.csv
+ mv \*.yml [MODEL TEAM DIRECTORY]/
+
+
+To create ``init.yml`` loading all accounts, use:
+
+.. code-block:: bash
+
+ cd [MODEL TEAM DIRECTORY]
+ echo 'classes:' > init.yml
+ ls| xargs -I{} basename {} .yml | sed 's/^/- /' >> init.yml
diff --git a/teams/team.csv b/teams/team.csv
new file mode 100644
index 0000000..de582a6
--- /dev/null
+++ b/teams/team.csv
@@ -0,0 +1,4 @@
+Bob Bar;bbar@mirantis.com;18234243156;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ....nkIT5ZgtlML bbar@bar-man.local
+Alice Foo;abob@mirantis.com;79172352570;ssh-rsa AAAAB3NzaC1yc2EAAA....XOHwoCRaV81XTHbR865+/sP afoo@fool-princess.local
+Bob Bar2;bbar2@mirantis.com;18234243156;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ....nkIT5ZgtlML bbar@bar-man.local
+Alice Foo2;abob2@mirantis.com;79172352570;ssh-rsa AAAAB3NzaC1yc2EAAA....XOHwoCRaV81XTHbR865+/sP afoo@fool-princess.local
diff --git a/teams/team.sh b/teams/team.sh
new file mode 100755
index 0000000..2b55e9e
--- /dev/null
+++ b/teams/team.sh
@@ -0,0 +1,9 @@
+#!/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 | xargs -n11 echo
diff --git a/teams/team.template b/teams/team.template
new file mode 100644
index 0000000..496c817
--- /dev/null
+++ b/teams/team.template
@@ -0,0 +1,21 @@
+parameters:
+ linux:
+ system:
+ user:
+ ${SNAME}:
+ enabled: true
+ name: ${SNAME}
+ sudo: true
+ full_name: ${FNAME}
+ home: /home/${SNAME}
+ email: ${EMAIL}
+ openssh:
+ server:
+ enabled: true
+ user:
+ ${SNAME}:
+ enabled: true
+ public_keys:
+ - key: ${KEY}
+ user: ${linux:system:user:${SNAME}}
+