On apprend à déployer une infra de façon reproductible, versionnée, sécurisée et automatisée.
À la fin de cette séance, vous serez capable de :
Vous arrivez dans une entreprise.
Un développeur vous dit :
"Pour lancer l’environnement : - démarre un conteneur - ouvre le port 8080 - copie les fichiers à la main"
Un autre développeur fait différemment.
Résultat :
Question :
En pratique, sans automatisation :
Exemples concrets :
Question :
Objectif :
Comprendre la difficulté de reproduire un environnement sans automatisation
Fichier : terminal
docker run -d -p 8081:80 --name test_nginx nginx
Validation :
Fichier : terminal
echo "<h1>Version 1</h1>" > index.html docker cp index.html test_nginx:/usr/share/nginx/html/index.html
Validation :
Fichier : terminal
docker rm -f test_nginx docker run -d -p 8081:80 --name test_nginx nginx
Questions :
Sans automatisation :
Question :
Principe :
Analogie :
Objectif :
Sans IaC :
Avec IaC :
Résultat :
On décrit les étapes :
Limite :
On décrit le résultat :
L’outil gère les actions nécessaires
Question :
Terraform :
Ansible :
Exemple :
Chaîne :
Code → Infrastructure → Configuration → Application
Dans le TD suivant :
Objectif :