After some research I succesfuly build a kind of workflow for our user to have their own configuration:
- Creating a bash script that retrieve user configuration from our gitlab
- When we create a new server we add into /etc/skell a line in shell files (.bashrc or .zshrc for example) for executing the script when they login. This step is done automaticly by our Ansible server.
- When they login for the first time, skell files are copied and then shell files are loaded (and then our script is executed)
#!/bin/bash
git clone "https://username:password@gitlab_url/ldap-user-config/$USER.git" > /dev/null 2>&1
if [ -d ${HOME}/${USER} ]
then
shopt -s dotglob
mv ${HOME}/${USER}/* ${HOME}/
shopt -u dotglob
rm -rf "$HOME/.git" "$HOME/$USER"
else
printf "Something goes wrong during cloning your config, contact an admin\n"
fi