Compare commits
2 Commits
9aca96187b
...
e10be16b85
| Author | SHA1 | Date | |
|---|---|---|---|
| e10be16b85 | |||
| 44c89e4e04 |
@ -13,4 +13,5 @@
|
|||||||
- include_tasks: tasks/users.yml
|
- include_tasks: tasks/users.yml
|
||||||
- include_tasks: tasks/cron.yml
|
- include_tasks: tasks/cron.yml
|
||||||
- include_tasks: tasks/packages.yml
|
- include_tasks: tasks/packages.yml
|
||||||
- include_tasks: tasks/loritz-user.yml
|
- include_tasks: tasks/loritz-user.yml
|
||||||
|
- include_tasks: tasks/bin.yml
|
||||||
7
tasks/bin.yml
Normal file
7
tasks/bin.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
- name: Copie scriptes vers bin
|
||||||
|
copy:
|
||||||
|
src: files/bin/
|
||||||
|
dest: /usr/bin/
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
39
tasks/files/bin/reset-loritz
Normal file
39
tasks/files/bin/reset-loritz
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Test si root
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Merci d'éxécuter en tant que root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Demande confirmation
|
||||||
|
while true; do
|
||||||
|
|
||||||
|
read -p "Etes vous sûr de vouloir réinitialiser l'utilisateur loritz ? (y/n) " yn
|
||||||
|
|
||||||
|
case $yn in
|
||||||
|
[yY] ) echo "OK, nous allons commencer !";
|
||||||
|
break;;
|
||||||
|
[nN] ) echo "Ah... Dommage";
|
||||||
|
exit;;
|
||||||
|
* ) echo Réponse invalide;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
# Début du travail
|
||||||
|
echo ""
|
||||||
|
echo "***** Réinitialisation de l'utilisateur loritz *****"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
userdel -r -f loritz
|
||||||
|
ansible-pull -U https://git.axolito.fr/Axel/laptop_playbook.git
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "***** Réinitialisation terminée *****"
|
||||||
|
echo ""
|
||||||
|
echo "***** Le PC va redémarrer dans 5 secondes *****"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
sleep 5s
|
||||||
|
reboot
|
||||||
Loading…
x
Reference in New Issue
Block a user