Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:centos:8:lcf1000:l1004 [2023/11/10 09:00] adminelearning:workbooks:centos:8:lcf1000:l1004 [2023/11/12 11:47] (Version actuelle) admin
Ligne 30: Ligne 30:
  
 L'infrastructure utilisée dans ce module est la suivante. L'infrastructure utilisée dans ce module est la suivante.
- 
-Stagiaires **11**, **12**, **14**, **15**, **16** et **17** : 
  
 ^ Type Machine ^ FQDN ^ IP ^  OS  ^  Version  ^  CPUs  ^  RAM (Mo)  ^  HDD (Go)  ^  User  ^  MdP  ^  MdP root  ^ ^ Type Machine ^ FQDN ^ IP ^  OS  ^  Version  ^  CPUs  ^  RAM (Mo)  ^  HDD (Go)  ^  User  ^  MdP  ^  MdP root  ^
Ligne 42: Ligne 40:
 | VM | targetb.i2tch.loc | 10.0.2.53 |  CentOS  |  7.6.1810  |  2  |  2048  |  20  |  trainee  |  trainee  |  fenestros  | | VM | targetb.i2tch.loc | 10.0.2.53 |  CentOS  |  7.6.1810  |  2  |  2048  |  20  |  trainee  |  trainee  |  fenestros  |
  
-Stagiaires **18**, **19**, **20**, **21**, **22** et **23** :+=====LAB #1 - La Commande chef-run=====
  
-^ Type Machine ^ FQDN ^ IP ^  OS  ^  Version  ^  CPUs  ^  RAM (Mo)  ^  HDD (Go)  ^  User  ^  MdP  ^  MdP root  ^ +====1.1 - Présentation====
-| VM | workstation.ittraining.loc | 10.0.3.111 |  Ubuntu  |  18.04.6 LTS |  8  |  8192  |  50  |  trainee  |  trainee  |  S/O  | +
-| VM | client.ittraining.loc | 10.0.3.112 |  Ubuntu  |  18.04.6 LTS |  4  |  4096  |  50  |  trainee  |  trainee  |  S/O  | +
-| VM | web01.i2tch.loc | 10.0.3.54 |  Debian  |  9.7  |  2  |  256  |  20  |  trainee  |  trainee  |  fenestros +
-| VM | web02.i2tch.loc | 10.0.3.55 |  Debian  |  9.7  |  2  |  256  |  20  |  trainee  |  trainee  |  fenestros +
-| VM | web03.i2tch.loc | 10.0.3.56 |  Debian  |  9.7  |  2  |  256  |  20  |  trainee  |  trainee  |  fenestros +
-| VM | targeta.i2tch.loc | 10.0.3.52 |  Debian  |  9.7  |  2  |  2048  |  20  |  trainee  |  trainee  |  fenestros +
-| VM | targetb.i2tch.loc | 10.0.3.53 |  CentOS  |  7.6.1810  |  2  |  2048  |  20  |  trainee  |  trainee  |  fenestros  |+
  
-Commencez donc par modifier le fichier **/etc/hosts** de votre VM **workstation.ittraining.loc**.+La commande **chef-run** permet d'exécuter des commandes ad-hoc localement ou sur des clients
  
-Stagiaires **11**, **12**, **14**, **15**, **16** et **17** :+Cette commande : 
 + 
 +  ne nécessite pas de Chef Infra Server, 
 +  ne nécessite pas de pré-installation de Chef Client sur le(s) client(s), 
 +  peut aussi exécuter une Recette ou un Cookbook, 
 +  peut configurer de multiples clients dans la même commande. 
 + 
 +====1.2 - Utiliser chef-run sur un Client Unique==== 
 + 
 +Commencez par modifier le fichier **/etc/hosts** de votre VM **workstation.ittraining.loc** :
  
 <code> <code>
Ligne 76: Ligne 76:
 ff02::2 ip6-allrouters ff02::2 ip6-allrouters
 </code> </code>
- 
-Stagiaires **18**, **19**, **20**, **21**, **22** et **23** : 
- 
-<code> 
-root@workstation:~/chef-repo/cookbooks# vi /etc/hosts 
-root@workstation:~/chef-repo/cookbooks# cat /etc/hosts 
-127.0.0.1       localhost 
-127.0.1.1       workstation 
-10.0.3.110      chefserver.ittraining.loc   chefserver 
-10.0.3.111      workstation.ittraining.loc  workstation 
-10.0.3.112      client.ittraining.loc       client 
-10.0.3.54       web01.i2tch.loc         web01 
-10.0.3.55       web02.i2tch.loc         web02 
-10.0.3.56       web03.i2tch.loc         web03 
- 
-# The following lines are desirable for IPv6 capable hosts 
-::1     ip6-localhost ip6-loopback 
-fe00::0 ip6-localnet 
-ff00::0 ip6-mcastprefix 
-ff02::1 ip6-allnodes 
-ff02::2 ip6-allrouters 
-</code> 
- 
-=====LAB #1 - La Commande chef-run===== 
- 
-====1.1 - Présentation==== 
- 
-La commande **chef-run** permet d'exécuter des commandes ad-hoc localement ou sur des clients.  
- 
-Cette commande : 
- 
-  * ne nécessite pas de Chef Infra Server, 
-  * ne nécessite pas de pré-installation de Chef Client sur le(s) client(s), 
-  * peut aussi exécuter une Recette ou un Cookbook, 
-  * peut configurer de multiples clients dans la même commande. 
- 
-====1.2 - Utiliser chef-run sur un Client Unique==== 
  
 Utilisez la commande **chef-run** pour arrêter le service apache2 sur la VM **web01.i2tch.loc** : Utilisez la commande **chef-run** pour arrêter le service apache2 sur la VM **web01.i2tch.loc** :
Ligne 138: Ligne 101:
 </code> </code>
  
-Connectez-vous à la VM **web01.i2tch.loc** à partir de votre VM **workstation.ittraining.loc**. +Connectez-vous à la VM **web01.i2tch.loc** à partir de votre VM **workstation.ittraining.loc** :
- +
-Stagiaires **11**, **12**, **14**, **15**, **16** et **17** :+
  
 <code> <code>
Ligne 159: Ligne 120:
 permitted by applicable law. permitted by applicable law.
 Last login: Thu Nov  2 13:35:52 2023 from 10.0.2.1 Last login: Thu Nov  2 13:35:52 2023 from 10.0.2.1
-</code> 
- 
-Stagiaires **18**, **19**, **20**, **21**, **22** et **23** : 
- 
-<code> 
-root@workstation:~/chef-repo/cookbooks# ssh -l trainee web01 
-The authenticity of host 'web01 (10.0.3.54)' can't be established. 
-ECDSA key fingerprint is SHA256:sEfHBv9azmK60cjqF/aJgUc9jg56slNaZQdAUcvBOvE. 
-Are you sure you want to continue connecting (yes/no)? yes 
-Warning: Permanently added 'web01,10.0.3.54' (ECDSA) to the list of known hosts. 
-Debian GNU/Linux 9 
-trainee@web01's password: trainee 
-Linux web01.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 
- 
-The programs included with the Debian GNU/Linux system are free software; 
-the exact distribution terms for each program are described in the 
-individual files in /usr/share/doc/*/copyright. 
- 
-Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
-permitted by applicable law. 
-Last login: Thu Nov  2 13:35:52 2023 from 10.0.3.1 
 </code> </code>
  
Ligne 371: Ligne 311:
 </WRAP> </WRAP>
  
-Vérifiez ensuite le statut du service apache2 sur les deux clients **web02.i2tch.loc** et **web03.i2tch.loc**. +Vérifiez ensuite le statut du service apache2 sur les deux clients **web02.i2tch.loc** et **web03.i2tch.loc** :
- +
-Stagiaires **11**, **12**, **14**, **15**, **16** et **17** :+
  
 <code> <code>
Ligne 434: Ligne 372:
 permitted by applicable law. permitted by applicable law.
 Last login: Thu Nov  2 13:57:50 2023 from 10.0.2.1 Last login: Thu Nov  2 13:57:50 2023 from 10.0.2.1
- 
-trainee@web03:~$ su - 
-Mot de passe : fenestros 
- 
-root@web03:~# systemctl status apache2 
-● apache2.service - The Apache HTTP Server 
-   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) 
-   Active: inactive (dead) since Thu 2023-11-02 14:12:37 CET; 2min 59s ago 
-  Process: 1390 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS) 
-  Process: 463 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) 
- Main PID: 497 (code=exited, status=0/SUCCESS) 
- 
-nov. 02 13:59:37 web03.i2tch.loc systemd[1]: Starting The Apache HTTP Server... 
-nov. 02 13:59:38 web03.i2tch.loc systemd[1]: Started The Apache HTTP Server. 
-nov. 02 14:12:36 web03.i2tch.loc systemd[1]: Stopping The Apache HTTP Server... 
-nov. 02 14:12:37 web03.i2tch.loc systemd[1]: Stopped The Apache HTTP Server. 
-</code> 
- 
-Stagiaires **18**, **19**, **20**, **21**, **22** et **23** : 
- 
-<code> 
-root@workstation:~/chef-repo/cookbooks# ssh -l trainee web02 
-The authenticity of host 'web02 (10.0.3.55)' can't be established. 
-ECDSA key fingerprint is SHA256:sEfHBv9azmK60cjqF/aJgUc9jg56slNaZQdAUcvBOvE. 
-Are you sure you want to continue connecting (yes/no)? yes 
-Warning: Permanently added 'web02,10.0.3.55' (ECDSA) to the list of known hosts. 
-Debian GNU/Linux 9 
-trainee@web02's password: trainee 
-Linux web02.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 
- 
-The programs included with the Debian GNU/Linux system are free software; 
-the exact distribution terms for each program are described in the 
-individual files in /usr/share/doc/*/copyright. 
- 
-Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
-permitted by applicable law. 
-Last login: Thu Nov  2 13:56:42 2023 from 10.0.3.1 
- 
-trainee@web02:~$ su - 
-Mot de passe : fenestros 
- 
-root@web02:~# systemctl status apache2 
-● apache2.service - The Apache HTTP Server 
-   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) 
-   Active: inactive (dead) since Thu 2023-11-02 14:12:37 CET; 57s ago 
-  Process: 1406 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS) 
-  Process: 445 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) 
- Main PID: 473 (code=exited, status=0/SUCCESS) 
- 
-nov. 02 13:59:22 web02.i2tch.loc systemd[1]: Starting The Apache HTTP Server... 
-nov. 02 13:59:22 web02.i2tch.loc systemd[1]: Started The Apache HTTP Server. 
-nov. 02 14:12:37 web02.i2tch.loc systemd[1]: Stopping The Apache HTTP Server... 
-nov. 02 14:12:37 web02.i2tch.loc systemd[1]: Stopped The Apache HTTP Server. 
-</code> 
- 
-<code> 
-root@web02:~# exit 
-déconnexion 
- 
-trainee@web02:~$ exit 
-déconnexion 
-Connection to web02 closed. 
- 
-root@workstation:~/chef-repo/cookbooks# ssh -l trainee web03 
-The authenticity of host 'web03 (10.0.3.56)' can't be established. 
-ECDSA key fingerprint is SHA256:sEfHBv9azmK60cjqF/aJgUc9jg56slNaZQdAUcvBOvE. 
-Are you sure you want to continue connecting (yes/no)? yes 
-Warning: Permanently added 'web03,10.0.3.56' (ECDSA) to the list of known hosts. 
-Debian GNU/Linux 9 
-trainee@web03's password: trainee 
-Linux web03.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 
- 
-The programs included with the Debian GNU/Linux system are free software; 
-the exact distribution terms for each program are described in the 
-individual files in /usr/share/doc/*/copyright. 
- 
-Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
-permitted by applicable law. 
-Last login: Thu Nov  2 13:57:50 2023 from 10.0.3.1 
  
 trainee@web03:~$ su - trainee@web03:~$ su -
Ligne 577: Ligne 436:
 ====1.4 - Utiliser chef-run avec un Cookbook==== ====1.4 - Utiliser chef-run avec un Cookbook====
  
-Installez le paquet **git* :+Installez le paquet **git** :
  
 <code> <code>
Ligne 599: Ligne 458:
 </code> </code>
  
-Le service apache2 ayant été arrêté précédemment, vérifiez que clui-ci a été re-démarr. +Le service apache2 ayant été arrêté précédemment, vérifiez que clui-ci a été re-démarré :
- +
-Stagiaires **11**, **12**, **14**, **15**, **16** et **17** :+
  
 <code> <code>
Ligne 616: Ligne 473:
 permitted by applicable law. permitted by applicable law.
 Last login: Thu Nov  2 14:08:53 2023 from 10.0.2.1 Last login: Thu Nov  2 14:08:53 2023 from 10.0.2.1
- 
-trainee@web01:~$ su - 
-Mot de passe : fenestros 
- 
-root@web01:~# systemctl status apache2 
-● apache2.service - The Apache HTTP Server 
-   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) 
-   Active: active (running) since Thu 2023-11-02 14:40:59 CET; 32s ago 
-  Process: 4208 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS) 
-  Process: 4360 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) 
- Main PID: 4364 (apache2) 
-    Tasks: 55 (limit: 4915) 
-   CGroup: /system.slice/apache2.service 
-           ├─4364 /usr/sbin/apache2 -k start 
-           ├─4365 /usr/sbin/apache2 -k start 
-           └─4366 /usr/sbin/apache2 -k start 
- 
-nov. 02 14:40:59 web01.i2tch.loc systemd[1]: Starting The Apache HTTP Server... 
-nov. 02 14:40:59 web01.i2tch.loc systemd[1]: Started The Apache HTTP Server. 
-</code> 
- 
-Stagiaires **18**, **19**, **20**, **21**, **22** et **23** : 
- 
-<code> 
-root@workstation:~/chef-repo/cookbooks# ssh -l trainee web01 
-Debian GNU/Linux 9 
-trainee@web01's password: trainee 
-Linux web01.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 
- 
-The programs included with the Debian GNU/Linux system are free software; 
-the exact distribution terms for each program are described in the 
-individual files in /usr/share/doc/*/copyright. 
- 
-Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
-permitted by applicable law. 
-Last login: Thu Nov  2 14:08:53 2023 from 10.0.3.1 
  
 trainee@web01:~$ su - trainee@web01:~$ su -
Ligne 751: Ligne 572:
 </code> </code>
  
-Connectez-vous ensuite à votre VM **ChefServer_10.0.2.110_VNC** ou **ChefServer_10.0.3.110_VNC** selon votre numéro de stagiaire.+Connectez-vous ensuite à votre VM **ChefServer_10.0.2.110_VNC**.
  
-Ouvrez le navigateur Web et naviguez à l'adresse **10.0.2.110** ou **10.0.3.110** selon le cas :+Ouvrez le navigateur Web et naviguez à l'adresse **10.0.2.110** :
  
 {{ :elearning:workbooks:centos:8:lcf1000:capture_d_ecran_du_2023-11-02_16-17-26.png?direct&600 |}} {{ :elearning:workbooks:centos:8:lcf1000:capture_d_ecran_du_2023-11-02_16-17-26.png?direct&600 |}}
Ligne 777: Ligne 598:
 {{ :elearning:workbooks:centos:8:lcf1000:capture_d_ecran_du_2023-11-02_16-33-35.png?direct&600 |}} {{ :elearning:workbooks:centos:8:lcf1000:capture_d_ecran_du_2023-11-02_16-33-35.png?direct&600 |}}
  
-Connectez-vous ensuite à votre VM **ChefServer_10.0.2.110_SSH** ou **ChefServer_10.0.3.110_SSH** selon votre numéro de stagiaire.+Connectez-vous ensuite à votre VM **ChefServer_10.0.2.110_SSH**.
  
 Modifiez maintenant la configuration du client **client.ittraining.loc** en référencant le Rôle dans le **run_list**. Sauvegardez et quittez le fichier : Modifiez maintenant la configuration du client **client.ittraining.loc** en référencant le Rôle dans le **run_list**. Sauvegardez et quittez le fichier :
Ligne 965: Ligne 786:
 ====3.3 - Ajout de Clients au Chef Infra Server==== ====3.3 - Ajout de Clients au Chef Infra Server====
  
-===Stagiaires **11**, **12**, **14**, **15**, **16** et **17**=== +Configurez deux nouveaux clients **targeta** et **targetb** :
- +
-Configurez deux nouveaux clients **targeta** et **targetb**.+
  
 <code> <code>
Ligne 1223: Ligne 1042:
  [10.0.2.53] downloading https://packages.chef.io/files/stable/chef/15.17.4/el/7/chef-15.17.4-1.el7.x86_64.rpm  [10.0.2.53] downloading https://packages.chef.io/files/stable/chef/15.17.4/el/7/chef-15.17.4-1.el7.x86_64.rpm
   to file /tmp/install.sh.14285/chef-15.17.4-1.el7.x86_64.rpm   to file /tmp/install.sh.14285/chef-15.17.4-1.el7.x86_64.rpm
-... 
-Chef Infra Client finished, 0/0 resources updated in 03 seconds 
-[2023-11-03T16:07:23+01:00] WARN: This release of Chef Infra Client became end of life (EOL) on May 1st 2021. Please update to a supported release to receive new features, bug fixes, and security updates. 
-</code> 
- 
-===Stagiaires **18**, **19**, **20**, **21**, **22** et **23**=== 
- 
-Configurez deux nouveaux clients **targeta** et **targetb**. 
- 
-<code> 
-root@workstation:~/chef-repo/cookbooks# ssh -l trainee 10.0.3.52 
-The authenticity of host '10.0.3.52 (10.0.3.52)' can't be established. 
-ECDSA key fingerprint is SHA256:sEfHBv9azmK60cjqF/aJgUc9jg56slNaZQdAUcvBOvE. 
-Are you sure you want to continue connecting (yes/no)? yes 
-Warning: Permanently added '10.0.3.52' (ECDSA) to the list of known hosts. 
-Debian GNU/Linux 9 
-trainee@10.0.3.52's password: trainee 
-Linux targeta.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 
- 
-The programs included with the Debian GNU/Linux system are free software; 
-the exact distribution terms for each program are described in the 
-individual files in /usr/share/doc/*/copyright. 
- 
-Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
-permitted by applicable law. 
-Last login: Sun Mar 21 08:47:45 2021 from 10.0.3.10 
- 
-trainee@targeta:~$ su - 
-Mot de passe : fenestros 
-</code> 
- 
-Editez la directive **PermitRootLogin** du fichier **/etc/ssh/sshd_config** afin de permettre l'utilisateur **root** de se connecter au client : 
- 
-<code> 
-root@targeta:~# vi /etc/ssh/sshd_config 
- 
-root@targeta:~# cat /etc/ssh/sshd_config 
-... 
-PermitRootLogin yes  
-... 
- 
-root@targeta:~# systemctl restart ssh 
-</code> 
- 
-Editez ensuite le fichier **/etc/hosts** : 
- 
-<code> 
-root@targeta:~# vi /etc/hosts 
-root@targeta:~# cat /etc/hosts 
-127.0.0.1       localhost 
-10.0.3.110      chefserver.ittraining.loc   chefserver 
-10.0.3.111      workstation.ittraining.loc  workstation 
-10.0.3.52       web02.i2tch.loc    web02  
-10.0.3.53       web03.i2tch.loc    web03 
- 
- 
-# The following lines are desirable for IPv6 capable hosts 
-::1     localhost ip6-localhost ip6-loopback 
-ff02::1 ip6-allnodes 
-ff02::2 ip6-allrouters 
-</code> 
- 
-Modifiez le FQDN de la VM : 
- 
-<code> 
-root@targeta:~# hostnamectl set-hostname web02.i2tch.loc 
-</code> 
- 
-Mettez à jour les dépôts des paquets : 
- 
-<code> 
-root@targeta:~# sed -i s/ftp.fr.debian.org/archive.debian.org/g /etc/apt/sources.list 
- 
-root@targeta:~# sed -i '/debian-security/d' /etc/apt/sources.list 
- 
-root@targeta:~# sed -i '/stretch-updates/d' /etc/apt/sources.list 
- 
-root@targeta:~# apt update 
-Ign:1 http://archive.debian.org/debian stretch InRelease 
-Réception de:2 http://archive.debian.org/debian stretch Release [118 kB] 
-Réception de:3 http://archive.debian.org/debian stretch Release.gpg [3 177 B] 
-Réception de:4 http://archive.debian.org/debian stretch/main Sources [6 736 kB] 
-Réception de:5 http://archive.debian.org/debian stretch/main amd64 Packages [7 080 kB] 
-Réception de:6 http://archive.debian.org/debian stretch/main Translation-fr [1 894 kB] 
-Réception de:7 http://archive.debian.org/debian stretch/main Translation-en [5 377 kB] 
-21,2 Mo réceptionnés en 6s (3 302 ko/s)                                                                                                                                                                       
-Lecture des listes de paquets... Fait 
-Construction de l'arbre des dépendances        
-Lecture des informations d'état... Fait 
-226 packages can be upgraded. Run 'apt list --upgradable' to see them. 
-</code> 
- 
-Créez le répertoire **/var/www/html** : 
- 
-<code> 
-root@targeta:~# mkdir -p /var/www/html 
-</code> 
- 
-Quittez la VM **targeta** : 
- 
-<code> 
-root@targeta:~# exit 
-déconnexion 
-trainee@targeta:~$ exit 
-déconnexion 
-Connection to 10.0.3.52 closed. 
-</code> 
- 
-Utilisez la commande **knife bootstrap** pour référencer le client avec le Chef Infra Server : 
- 
-<code> 
-root@workstation:~/chef-repo/cookbooks# knife bootstrap 10.0.3.52 --ssh-user root --ssh-password fenestros --node-name web02 
-Connecting to 10.0.3.52 
-The authenticity of host '10.0.3.52 ()' can't be established. 
-fingerprint is SHA256:Tk/PXJFmWnE96DhFsYAaFqgHQXPJhw+ArPP/GG9IJTw. 
- 
-Are you sure you want to continue connecting 
-? (Y/N) Y 
-Connecting to 10.0.3.52 
-Creating new client for web02 
-Creating new node for web02 
-Bootstrapping 10.0.3.52 
- [10.0.3.52] -----> Installing Chef Omnibus (stable/15) 
-downloading https://omnitruck.chef.io/chef/install.sh 
-  to file /tmp/install.sh.1340/install.sh 
-trying wget... 
- [10.0.3.52] debian 9 x86_64 
-Getting information for chef stable 15 for debian... 
-downloading https://omnitruck.chef.io/stable/chef/metadata?v=15&p=debian&pv=9&m=x86_64 
-  to file /tmp/install.sh.1344/metadata.txt 
- [10.0.3.52] trying wget... 
- [10.0.3.52] sha1       168e534c58f9e17394bc9ba7112ee2280fecdd79 
-sha256  a50884a3c0be26875c329de9a1cea854eacb0a0a1ed031301ee6c29aad0f19ed 
-url     https://packages.chef.io/files/stable/chef/15.17.4/debian/9/chef_15.17.4-1_amd64.deb 
-version 15.17.4 
-... 
- [10.0.3.52] Chef Infra Client finished, 0/0 resources updated in 01 seconds 
- [10.0.3.52]  
- [10.0.3.52] [2023-11-03T15:53:49+01:00] WARN: This release of Chef Infra Client became end of life (EOL) on May 1st 2021. Please update to a supported release to receive new features, bug fixes, and security updates. 
-</code> 
- 
-Connectez-vous à la VM **targetb** : 
- 
-<code> 
-root@workstation:~/chef-repo/cookbooks# ssh -l trainee 10.0.3.53 
-The authenticity of host '10.0.3.53 (10.0.3.53)' can't be established. 
-ECDSA key fingerprint is SHA256:RgOsp/XI7JHNq+oIfHKw+jkHdtTnBIh+Dd7kVmHRxtU. 
-Are you sure you want to continue connecting (yes/no)? yes 
-Warning: Permanently added '10.0.3.53' (ECDSA) to the list of known hosts. 
-trainee@10.0.3.53's password: trainee 
-Last login: Sun Mar 21 08:53:18 2021 from 10.0.3.10 
-[trainee@targetb ~]$ su - 
-Password: fenestros 
-Last login: dim. mars 21 08:53:25 CET 2021 on pts/0 
-</code> 
- 
-Modifiez la directive **PermitRootLogin** du fichier **/etc/ssh/sshd_config** afin de permettre l'utilisateur **root** de se connecter au client : 
- 
-<code> 
-[root@targetb ~]# vi /etc/ssh/sshd_config  
- 
-[root@targetb ~]# cat /etc/ssh/sshd_config  
-#       $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $ 
- 
-# This is the sshd server system-wide configuration file.  See 
-# sshd_config(5) for more information. 
- 
-# This sshd was compiled with PATH=/usr/local/bin:/usr/bin 
- 
-# The strategy used for options in the default sshd_config shipped with 
-# OpenSSH is to specify options with their default value where 
-# possible, but leave them commented.  Uncommented options override the 
-# default value. 
- 
-# If you want to change the port on a SELinux system, you have to tell 
-# SELinux about this change. 
-# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER 
-... 
-PermitRootLogin yes 
-... 
- 
-[root@targetb ~]# systemctl restart sshd 
-</code> 
- 
-Editez ensuite le fichier **/etc/hosts** : 
- 
-<code> 
-[root@targetb ~]# vi /etc/hosts 
- 
-[root@targetb ~]# cat /etc/hosts 
-127.0.0.1               localhost.localdomain localhost 
-::1             localhost6.localdomain6 localhost6 
-10.0.3.110      chefserver.ittraining.loc   chefserver 
-10.0.3.111      workstation.ittraining.loc  workstation 
-10.0.3.52       web02.i2tch.loc    web02 
-10.0.3.53       web03.i2tch.loc    web03 
-</code> 
- 
-Modifiez le FQDN de la VM : 
- 
-<code> 
-[root@targetb ~]# hostnamectl set-hostname web03.i2tch.loc 
-</code> 
- 
-La VM **targetb** étant une CentOS 7, le paquet **nginx** est disponible dans le dépôt **epel-release**. Installez donc ce dépôt : 
- 
-<code> 
-[root@targetb ~]# yum install epel-release 
-</code> 
- 
-Créez le répertoire **/var/www/html** : 
- 
-<code> 
-[root@targetb ~]# mkdir -p /var/www/html 
-</code> 
- 
-Déconnectez-vous de la VM : 
- 
-<code> 
-[root@targetb ~]# exit 
-déconnexion 
- 
-trainee@targetb:~$ exit 
-déconnexion 
-</code> 
- 
-Utilisez la commande **knife bootstrap** pour référencer le client avec le Chef Infra Server : 
- 
-<code> 
-root@workstation:~/chef-repo/cookbooks# knife bootstrap 10.0.3.53 --ssh-user root --ssh-password fenestros --node-name web03 
---ssh-user: This flag is deprecated. Use -U/--connection-user instead. 
---ssh-password: This flag is deprecated. Use -P/--connection-password instead. 
-Connecting to 10.0.3.53 
-The authenticity of host '10.0.3.53 ()' can't be established. 
-fingerprint is SHA256:PokJEptX8i3G+Qdy2WFX9xWby1d+l/0FhVyN1onGXnQ. 
- 
-Are you sure you want to continue connecting 
-? (Y/N) Y 
-Connecting to 10.0.3.53 
-Creating new client for web03 
-Creating new node for web03 
-Bootstrapping 10.0.3.53 
- [10.0.3.53] -----> Installing Chef Omnibus (stable/15) 
-downloading https://omnitruck.chef.io/chef/install.sh 
-  to file /tmp/install.sh.14275/install.sh 
-trying wget... 
- [10.0.3.53] el 7 x86_64 
-Getting information for chef stable 15 for el... 
-downloading https://omnitruck.chef.io/stable/chef/metadata?v=15&p=el&pv=7&m=x86_64 
-  to file /tmp/install.sh.14285/metadata.txt 
- [10.0.3.53] trying wget... 
- [10.0.3.53] sha1       9e066d888611971a1dceb7c3eaf0375a6c61ebd0 
-sha256  0aaf56d149bdddc73b501322777ac378e2ffb63aa6eb714d93b16714e166e4f0 
-url     https://packages.chef.io/files/stable/chef/15.17.4/el/7/chef-15.17.4-1.el7.x86_64.rpm 
-version 15.17.4 
 ... ...
 Chef Infra Client finished, 0/0 resources updated in 03 seconds Chef Infra Client finished, 0/0 resources updated in 03 seconds
Ligne 1485: Ligne 1049:
 ====3.4 - Configuration des Environnements==== ====3.4 - Configuration des Environnements====
  
-Editez le fichier **/etc/hosts** de votre VM **workstation.ittraining.loc**. +Editez le fichier **/etc/hosts** de votre VM **workstation.ittraining.loc** :
- +
-Stagiaires **11**, **12**, **14**, **15**, **16** et **17** :+
  
 <code> <code>
Ligne 1508: Ligne 1070:
 </code> </code>
  
-Stagiaires **18**, **19**, **20**, **21**, **22** et **23** : +Connectez-vous ensuite à votre VM **ChefServer_10.0.2.110_VNC**.
- +
-<code> +
-root@workstation:~/chef-repo/cookbooks# vi /etc/hosts +
-root@workstation:~/chef-repo/cookbooks# cat /etc/hosts +
-127.0.0.1       localhost +
-127.0.1.1       workstation +
-10.0.3.110      chefserver.ittraining.loc   chefserver +
-10.0.3.111      workstation.ittraining.loc  workstation +
-10.0.3.112      client.ittraining.loc       client +
-10.0.3.52       web02.i2tch.loc    web02 +
-10.0.3.53       web03.i2tch.loc    web03 +
- +
-# The following lines are desirable for IPv6 capable hosts +
-::1     ip6-localhost ip6-loopback +
-fe00::0 ip6-localnet +
-ff00::0 ip6-mcastprefix +
-ff02::1 ip6-allnodes +
-ff02::2 ip6-allrouters +
-</code> +
- +
-Connectez-vous ensuite à votre VM **ChefServer_10.0.2.110_VNC** ou **ChefServer_10.0.3.110_VNC** selon votre numéro de stagiaire.+
  
-Ouvrez le navigateur Web et naviguez à l'adresse **10.0.2.110** ou **10.0.3.110** selon le cas :+Ouvrez le navigateur Web et naviguez à l'adresse **10.0.2.110** :
  
 {{ :elearning:workbooks:centos:8:lcf1000:capture_d_ecran_du_2023-11-03_13-50-25.png?600 |}} {{ :elearning:workbooks:centos:8:lcf1000:capture_d_ecran_du_2023-11-03_13-50-25.png?600 |}}
Menu