Formation mass scripting

362 views
351 views

Published on

Automatiser sans Puppet, Chef ou Ansible ? Avec du ssh, script sh et expect on peut faire déjà beaucoup.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
362
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Formation mass scripting

  1. 1. Base ExemplesMass scripting Scripting Nicolas Ledez 15 septembre 2008 Nicolas Ledez Mass scripting Scripting
  2. 2. Base ExemplesOutline 1 Base 2 Exemples Nicolas Ledez Mass scripting Scripting
  3. 3. Base Architecture Exemples Script sur le serveurArchitecture Nicolas Ledez Mass scripting Scripting
  4. 4. Base Architecture Exemples Script sur le serveurScript sur le serveur Copier le script sur le serveur Lancer le script sur le serveur Supprimer le script du serveur scp le_script le_serveur :tmp ssh le_serveur sh tmple_script ssh le_serveur rm tmple_script Nicolas Ledez Mass scripting Scripting
  5. 5. Base Script sur le serveur Exemples Rien sur le serveurScript sur la station + remote sh if [ [ " $1 " == " " ] ] ; then echo " You must t a k e me a hostname " exit 1 fi c a t << EOF | ssh $1 / b i n / sh − cd / tmp ls EOF Nicolas Ledez Mass scripting Scripting
  6. 6. Base Script sur le serveur Exemples Rien sur le serveurScript sur la station + remote expect if [ [ " $1 " == " " ] ] ; then echo " You must t a k e me a hostname " exit 1 fi c a t << EOF | ssh $1 / u s r / l o c a l / b i n / expect − spawn passwd $ {PASS_USER} expect "New Password : " send " $ {PASSWD} r " expect " Re−e n t e r new Password : " send " $ {PASSWD} r " expect e o f EOF Nicolas Ledez Mass scripting Scripting
  7. 7. Base Script sur le serveur Exemples Rien sur le serveurScript sur la station + local expect if [ [ " $1 " == " " ] ] ; then echo " You must t a k e me a hostname " exit 1 fi expect << EOF spawn ssh − t $1 passwd $ {PASS_USER} expect "New Password : " send " $ {PASSWD} r " expect " Re−e n t e r new Password : " send " $ {PASSWD} r " expect e o f EOF Nicolas Ledez Mass scripting Scripting
  8. 8. Base Script sur le serveur Exemples Rien sur le serveurConclusion Conclusion Nicolas Ledez Mass scripting Scripting
  9. 9. Base Script sur le serveur Exemples Rien sur le serveurQuestions Questions ? Nicolas Ledez Mass scripting Scripting

×