Scribe+eole-ad+samba-ad-dc-conteneur » Historique » Version 11
Gérald Schwartzmann, 26/02/2018 17:14
| 1 | 1 | Joël Cuissinat | h1. Scribe+eole-ad+samba-ad-dc-conteneur |
|---|---|---|---|
| 2 | 1 | Joël Cuissinat | |
| 3 | 1 | Joël Cuissinat | On part d'un Scribe sur lequel on installe et on configure le service samba-ad-dc dans un conteneur LXC puis on met en œuvre Eole-AD comme si on avait deux serveurs distincts. |
| 4 | 1 | Joël Cuissinat | |
| 5 | 1 | Joël Cuissinat | _Pour la maquette, j'ai choisi d'utiliser un serveur aca.scribe-2.6.2-instance-AvecImport afin de minimiser les problèmes liés à l'environnement réseau._ |
| 6 | 1 | Joël Cuissinat | |
| 7 | 1 | Joël Cuissinat | h2. Mise en œuvre de samba-ad-dc dans un conteneur LXC |
| 8 | 1 | Joël Cuissinat | |
| 9 | 1 | Joël Cuissinat | Pour mettre en place le conteneur, nous sommes repartis de l'étude précédente ("Mise en œuvre du module Seth dans un conteneur LXC":https://dev-eole.ac-dijon.fr/projects/scribe/wiki/Scribe+eole-ad+Seth-conteneur#Mise-en-%C5%93uvre-du-module-Seth-dans-un-conteneur-LXC). |
| 10 | 1 | Joël Cuissinat | |
| 11 | 1 | Joël Cuissinat | Toutes les étapes ont été intégrées afin d'obtenir une procédure automatisée (script joint). |
| 12 | 1 | Joël Cuissinat | |
| 13 | 1 | Joël Cuissinat | h3. Détails du script |
| 14 | 1 | Joël Cuissinat | |
| 15 | 1 | Joël Cuissinat | Comme dans l'étude précédente, le conteneur doit posséder 2 IP : |
| 16 | 1 | Joël Cuissinat | * une sur le bridge interne, actuellement forcée en 192.0.2.2 |
| 17 | 1 | Joël Cuissinat | * une sur le réseau "pédagogique" qui est à choisir dans la même plage d'adresses que celle du module Scribe (exemple : 192.168.0.27 en "aca") |
| 18 | 1 | Joël Cuissinat | |
| 19 | 1 | Joël Cuissinat | _NB : Comme cette dernière adresse est en mode bridge, le maître (module Scribe) ne la voit pas._ |
| 20 | 1 | Joël Cuissinat | |
| 21 | 1 | Joël Cuissinat | Le script exécute les étapes suivantes : |
| 22 | 1 | Joël Cuissinat | * installation des paquets nécessaires sur le maître |
| 23 | 1 | Joël Cuissinat | * génération d'un conteneur lxc "ubuntu" |
| 24 | 1 | Joël Cuissinat | * configuration du conteneur (réseau, clés SSH) |
| 25 | 1 | Joël Cuissinat | * pré-paramétrage des services (/etc/krb5.conf, /etc/nsswitch.conf, /etc/eole/samba4-vars.conf) |
| 26 | 2 | Joël Cuissinat | * installation des libraires et des scripts (samba4.sh, validSambaPassword, ...), FIXME : cette partie effectue actuellement des copies de fichiers depuis le maître ainsi que des *wget sur gitweb* |
| 27 | 1 | Joël Cuissinat | * configuration des sources.list EOLE et samba-4.7 |
| 28 | 1 | Joël Cuissinat | * démarrage du conteneur |
| 29 | 1 | Joël Cuissinat | * installation des paquets samba-4.7 |
| 30 | 1 | Joël Cuissinat | * configuration de samba |
| 31 | 1 | Joël Cuissinat | * initialisation du DC à l'aide des scripts du module Seth _(samba_instance)_ |
| 32 | 1 | Joël Cuissinat | |
| 33 | 1 | Joël Cuissinat | h3. Résultat |
| 34 | 1 | Joël Cuissinat | |
| 35 | 1 | Joël Cuissinat | Une fois le script exécuté, le service samba-ad-dc est totalement fonctionnel dans le conteneur. |
| 36 | 4 | Gérald Schwartzmann | <pre> |
| 37 | 4 | Gérald Schwartzmann | ssh 192.0.2.2 |
| 38 | 4 | Gérald Schwartzmann | service samba-ad-dc status |
| 39 | 4 | Gérald Schwartzmann | </pre> |
| 40 | 4 | Gérald Schwartzmann | |
| 41 | 1 | Joël Cuissinat | Il est possible de joindre une station au domaine. |
| 42 | 1 | Joël Cuissinat | |
| 43 | 5 | Gérald Schwartzmann | * Le DNS à utiliser est l'adresse qui a été choisie sur le réseau "pédagogique" (192.168.0.27 dans notre exemple, cette IP peut être retrouvée ssh sur le conteneur, IP eth0) |
| 44 | 1 | Joël Cuissinat | * Le nom du domaine à utiliser correspond au "Nom DNS du réseau local" du module Scribe (ac-test.fr dans notre exemple) |
| 45 | 6 | Joël Cuissinat | |
| 46 | 6 | Joël Cuissinat | h2. Mise en place d'Eole-AD sur Scribe |
| 47 | 6 | Joël Cuissinat | |
| 48 | 6 | Joël Cuissinat | Utilisation de la procédure habituelle : installation du paquet + configuration + enregistrement des certificats d'autorité. |
| 49 | 6 | Joël Cuissinat | |
| 50 | 8 | Gérald Schwartzmann | h3. Installation |
| 51 | 8 | Gérald Schwartzmann | |
| 52 | 8 | Gérald Schwartzmann | <pre> |
| 53 | 8 | Gérald Schwartzmann | apt-eole install eole-ad |
| 54 | 8 | Gérald Schwartzmann | </pre> |
| 55 | 8 | Gérald Schwartzmann | |
| 56 | 6 | Joël Cuissinat | *Tous les paramètres à renseigner peuvent être calculés.* |
| 57 | 6 | Joël Cuissinat | |
| 58 | 6 | Joël Cuissinat | Le dictionnaire joint pré-remplit tout ce qui doit l'être (FIXME : en l'état, cela écrase les "noms d'hôtes supplémentaires" ajoutés par les utilisateurs). |
| 59 | 7 | Gérald Schwartzmann | |
| 60 | 7 | Gérald Schwartzmann | <pre> |
| 61 | 7 | Gérald Schwartzmann | wget https://dev-eole.ac-dijon.fr/attachments/download/2613/27_eolead_container.xml |
| 62 | 7 | Gérald Schwartzmann | </pre> |
| 63 | 7 | Gérald Schwartzmann | |
| 64 | 7 | Gérald Schwartzmann | <pre> |
| 65 | 7 | Gérald Schwartzmann | mv 27_eolead_container.xml /usr/share/eole/creole/dicos/ |
| 66 | 8 | Gérald Schwartzmann | </pre> |
| 67 | 8 | Gérald Schwartzmann | |
| 68 | 8 | Gérald Schwartzmann | <pre> |
| 69 | 8 | Gérald Schwartzmann | gen_config |
| 70 | 8 | Gérald Schwartzmann | </pre> |
| 71 | 8 | Gérald Schwartzmann | |
| 72 | 9 | Gérald Schwartzmann | Adresse du serveur NTP → 192.0.2.2 |
| 73 | 9 | Gérald Schwartzmann | |
| 74 | 8 | Gérald Schwartzmann | <pre> |
| 75 | 11 | Gérald Schwartzmann | instance |
| 76 | 11 | Gérald Schwartzmann | </pre> |
| 77 | 11 | Gérald Schwartzmann | |
| 78 | 11 | Gérald Schwartzmann | Copie de la clé secrète |
| 79 | 11 | Gérald Schwartzmann | |
| 80 | 11 | Gérald Schwartzmann | <pre> |
| 81 | 8 | Gérald Schwartzmann | root@scribe:~# scp 192.0.2.2:/var/lib/samba/private/tls/ca.pem /root/ |
| 82 | 8 | Gérald Schwartzmann | </pre> |
| 83 | 8 | Gérald Schwartzmann | |
| 84 | 8 | Gérald Schwartzmann | <pre> |
| 85 | 7 | Gérald Schwartzmann | root@scribe:~# keytool -import -trustcacerts -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt -alias eole-ad -file /root/ca.pem |
| 86 | 10 | Gérald Schwartzmann | </pre> |
| 87 | 1 | Joël Cuissinat | |
| 88 | 11 | Gérald Schwartzmann | En une seule commande en passant par le filesystem du conteneur : |
| 89 | 10 | Gérald Schwartzmann | |
| 90 | 10 | Gérald Schwartzmann | <pre> |
| 91 | 10 | Gérald Schwartzmann | keytool -import -trustcacerts -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt -alias eole-ad -file /var/lib/lxc/addc/rootfs/var/lib/samba/private/tls/ca.pem |
| 92 | 10 | Gérald Schwartzmann | </pre> |