# 📘 Automatisation & DĂ©ploiement — Serveurs ap31 (Prod / Test / Moniteur) Ce projet regroupe plusieurs missions rĂ©alisĂ©es dans le cadre du BTS SIO SISR. L’objectif gĂ©nĂ©ral est **d’automatiser l’installation, la configuration et la supervision** des serveurs ap3x grĂące Ă  *Ansible*, *Docker*, *Payara*, *MariaDB*, *WireGuard*, *GLPI*, et *Caddy*. --- # 📑 Sommaire 1. [Contexte du projet](#-contexte-du-projet) 2. [Environnement technique](#-environnement-technique) 3. [Mission I6 — Automatisation Ansible (Docker / Payara / MariaDB)](#-mission-i6--automatisation-ansible) 4. [Mission I7 — Mise en place d’un VPN WireGuard](#-mission-i7--mise-en-place-dun-vpn-wireguard) 5. [Mission I9 — Serveur GLPI + Proxy Inverse Caddy + HTTPS](#-mission-i9--serveur-glpi--proxy-inverse-caddy--https) 6. [Ports ouverts & Firewall](#-ports-ouverts--firewall) 7. [Captures d’écran](#-captures-dĂ©cran) 8. [DĂ©finitions & technologies utilisĂ©es](#-dĂ©finitions--technologies-utilisĂ©es) 9. [Liens vers les playbooks & fichiers](#-liens-vers-les-playbooks--fichiers) --- # 📂 Contexte du projet Les serveurs concernĂ©s : | Serveur | RĂŽle | |----------------|--------------------------------| | **ap31-prod** | Serveur de production | | **ap31-test** | Serveur de test | | **ap31-mon** | Serveur de supervision / logs | | **ap31-pt** | Serveur hĂ©bergeant GLPI + Caddy | --- # đŸ› ïž Environnement technique | Outil / Technologie | Usage | |---------------------|--------| | **Ansible** | Automatisation de l’installation et configuration | | **Docker / Docker Compose** | Conteneurisation (Payara, GLPI, MariaDB) | | **Payara Server** | Serveur d'applications Java (remplaçant moderne de Tomcat) | | **MariaDB / MySQL** | Base de donnĂ©es pour Payara et GLPI | | **WireGuard** | VPN entre les serveurs prod / test / mon | | **Caddy** | Proxy inverse + HTTPS auto-signĂ© | | **GLPI 11** | Gestion du parc informatique | --- # đŸ§© Mission I6 — Automatisation Ansible ## 🎯 Objectifs - Installer automatiquement **Docker**, **Payara**, et les conteneurs associĂ©s - Installer **MariaDB**, crĂ©er la base et les comptes - Injecter un **dump SQL local** - TĂ©lĂ©charger un dump compressĂ© depuis la base distante ## 📌 Structure des playbooks ### **1. Installation Docker + Payara** Playbook : `payara.yml` âžĄïž installe Docker via `get-docker.sh`, configure Payara, lance les conteneurs. ### **2. Base de donnĂ©es + comptes + Dump** Playbook : `apdb.yml` âžĄïž crĂ©ation DB, crĂ©ation utilisateurs, import du dump. ### **3. RĂ©cupĂ©ration d’un dump distant** Playbook : `apdbdump.yml` âžĄïž tĂ©lĂ©chargement du dump compressĂ© sur la machine locale. --- # 🔐 Mission I7 — Mise en place d’un VPN WireGuard ## 🎯 Objectifs - Relier **ap3x-prod**, **ap3x-test**, **ap3x-mon** via un VPN chiffrĂ© - TransfĂ©rer les logs des serveurs prod/test vers ap3x-mon via VPN - Faciliter la supervision (Ă©tape facultative) ## 📌 Playbook utilisĂ© : `wg.yml` Ce playbook : - Installe WireGuard sur les 3 machines - GĂ©nĂšre les fichiers de configuration (`wg0-*.conf`) sur ap3x-mon - DĂ©ploie la configuration adaptĂ©e sur chaque serveur - Active le service WireGuard --- # đŸ–„ïž Mission I9 — DĂ©ploiement GLPI + Proxy inverse Caddy ## 🎯 Objectifs - HĂ©berger **GLPI 11** via Docker (GLPI + MariaDB) - Tester la remontĂ©e d’inventaire depuis **glpi-agent** sous Linux - Écrire un playbook Ansible d’installation - Mettre en place un **proxy inverse Caddy** avec **HTTPS interne** --- ## 📌 docker-compose.yml (GLPI) Disponible ici : 🔗 **docker-compose.yml** https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/files/docker-compose.yml 🔗 **compose.yml (Payara)** https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/files/compose.yml --- ## 📌 Caddyfile (reverse proxy + HTTPS interne) ```conf ap31-pt.sio.lan { tls internal # certificat auto-signĂ© par Caddy reverse_proxy localhost:4000 # Proxy vers GLPI } ap31-pt { tls internal reverse_proxy localhost:4000 } ``` --- ## 📌 Test de remontĂ©e d’inventaire (glpi-agent) ```sh vagrant@glpi-agent:~$ sudo glpi-agent --no-ssl-check --server https://ap31-pt.sio.lan [info] target server0: server https://ap31-pt.sio.lan [info] sending contact request to server0 [info] [http client] SSL Client info: Cert-Issuer: '/CN=Caddy Local Authority - ECC Intermediate' [info] running task Inventory [info] New inventory from glpi-agent-2025-12-05-09-30-21 for server0 [info] [http client] SSL Client warning: Peer certificate not verified ``` --- ## đŸ”„ Ports ouverts & Firewall ```sh debian@ap31-pt:~$ sudo ufw status verbose Status: active Logging: on (low) Default: deny (incoming), allow (outgoing), deny (routed) New profiles: skip To Action From -- ------ ---- 80/tcp ALLOW IN Anywhere 443/tcp ALLOW IN Anywhere 8080/tcp ALLOW IN Anywhere 22/tcp ALLOW IN Anywhere ``` --- ## đŸ–Œïž Captures d’écran ###📌 GLPI (remplace les balises par tes images) ###📌 Payara (bon fonctionnement) --- ##📚 DĂ©finitions & technologies utilisĂ©es Payara: Serveur d’applications Java moderne, dĂ©rivĂ© de GlassFish. Permet d’hĂ©berger des applications web Java EE / Jakarta EE. GLPI: Outil de gestion de parc informatique : - inventaire des machines - gestion des tickets - pĂ©riphĂ©riques - contrats, licences, garanties WireGuard: VPN moderne, trĂšs rapide, extrĂȘmement simple Ă  configurer. Caddy Serveur web + reverse proxy capable d’émettre automatiquement des certificats HTTPS (ici : CA interne). --- | Fichier |Lien | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **payara.yml** | [https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/payara.yml](https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/payara.yml) | | **install-glpi.yml** | [https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/install-glpi.yml](https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/install-glpi.yml) | | **docker-compose.yml** | [https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/files/docker-compose.yml](https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/files/docker-compose.yml) | | **compose.yml** | [https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/files/compose.yml](https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/files/compose.yml) | | **wg.yml** | [https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/files/compose.yml] (https://gitea.lyc-lecastel.fr/uap31-2026-r/SDIS29/src/branch/main/partie2/ansible/files/compose.yml) |