forked from team/makeuser
Changes from makeuser_ansible function to reading from a file
This commit is contained in:
parent
93ffa85803
commit
8fd0421e7b
|
@ -0,0 +1,24 @@
|
|||
currdir=`pwd`
|
||||
cd $REPO_LOCATION; git pull
|
||||
echo "---
|
||||
- name: Setting up $1
|
||||
user:
|
||||
name: $1
|
||||
groups: tilde
|
||||
state: present
|
||||
skeleton: /etc/skel
|
||||
shell: /bin/bash
|
||||
system: no
|
||||
createhome: yes
|
||||
home: /home/$1
|
||||
- authorized_key:
|
||||
user: $1
|
||||
state: present
|
||||
key: \"$3\"" > $REPO_LOCATION/roles/shell/tasks/users/$YAML_FILE
|
||||
|
||||
echo "- include: users/$YAML_FILE" >> $REPO_LOCATION/roles/shell/tasks/users.yml
|
||||
git add $REPO_LOCATION/roles/shell/tasks/users/$YAML_FILE
|
||||
git commit -am "Adding user $1"
|
||||
git push
|
||||
cd $currdir
|
||||
$GEN_TDP | sudo tee $TILDE_JSON
|
|
@ -34,34 +34,6 @@ makeuser_no_ansible()
|
|||
#sudo toot "welcome new user ~$1!"
|
||||
}
|
||||
|
||||
makeuser_ansible()
|
||||
{
|
||||
currdir=`pwd`
|
||||
cd $REPO_LOCATION; git pull
|
||||
echo "---
|
||||
- name: Setting up $1
|
||||
user:
|
||||
name: $1
|
||||
groups: tilde
|
||||
state: present
|
||||
skeleton: /etc/skel
|
||||
shell: /bin/bash
|
||||
system: no
|
||||
createhome: yes
|
||||
home: /home/$1
|
||||
- authorized_key:
|
||||
user: $1
|
||||
state: present
|
||||
key: \"$3\"" > $REPO_LOCATION/roles/shell/tasks/users/$YAML_FILE
|
||||
|
||||
echo "- include: users/$YAML_FILE" >> $REPO_LOCATION/roles/shell/tasks/users.yml
|
||||
git add $REPO_LOCATION/roles/shell/tasks/users/$YAML_FILE
|
||||
git commit -am "Adding user $1"
|
||||
git push
|
||||
cd $currdir
|
||||
$GEN_TDP | sudo tee $TILDE_JSON
|
||||
}
|
||||
|
||||
add_account_recovery()
|
||||
{
|
||||
sudo mkdir -p --mode=700 /home/$1/.thunix
|
||||
|
|
Loading…
Reference in New Issue