Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| elearning:workbooks:debian:6:avance:l129:part5 [2019/11/14 06:16] – admin | elearning:workbooks:debian:6:avance:l129:part5 [2022/06/22 11:51] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ~~PDF: | ~~PDF: | ||
| + | |||
| + | Version : **2022.01** | ||
| Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
| Ligne 5: | Ligne 7: | ||
| ======DOF405 - Puppet en mode Agent/ | ======DOF405 - Puppet en mode Agent/ | ||
| - | =====LAB #27 - Installer Puppet en mode Agent/ | + | =====Contenu du Module===== |
| - | ====Importation de vos Machines Virtuelles==== | + | * **DOF405 - Puppet en mode Agent/ |
| + | * Contenu du Module | ||
| + | * Préparation | ||
| + | * Configuration du Fuseau d' | ||
| + | * Désactiver SELinux dans puppetslave02 | ||
| + | * LAB #1 - Configurer Puppet Server | ||
| + | * Installer puppetserver | ||
| + | * Configurer puppetserver | ||
| + | * LAB #2 - Installer et Configurer puppet-agent sur les Machines Virtuelles | ||
| + | * Installer puppet-agent | ||
| + | * Configurer puppet-agent | ||
| + | * LAB #3 - Création d'un Utilisateur | ||
| + | * LAB #4 - Configuration de ssh | ||
| + | * LAB #5 - Configuration d'IP Tables | ||
| + | * Exécuter l' | ||
| + | * Exécuter l' | ||
| + | * LAB #6 - Déployer Apache avec Puppet en mode Agent/ | ||
| + | * Création du Rôle | ||
| + | * Création des Manifests | ||
| + | * Création des Fichiers de Configuration | ||
| + | * Création des Templates | ||
| + | * Déployer Apache | ||
| - | Arrêtez la machine virtuelle vagrant. **Après** avoir fait le test **Validation des Acquis**, ouvrez VirtualBox et importez les machines virtuelles **PuppetMaster**, | + | =====Préparation===== |
| - | Fichier > Importer un appareil virtuel ... | + | Les trois machines virtuelles **PuppetMaster**, **PuppetSlave01** et **PuppetSlave02** ont été configurées selon le tableau ci-dessous |
| - | + | ||
| - | Les trois machines virtuelles | + | |
| ^ Machine ^ Nom d' | ^ Machine ^ Nom d' | ||
| - | | PuppetMaster | master.i2tch.loc | 10.0.2.4 | Ubuntu 18.04 | 4Go | | + | | PuppetMaster | master.i2tch.loc | 10.0.2.59 | Ubuntu 18.04 | 4096 Mo | |
| - | | PuppetSlave01 | slave01.i2tch.loc | 10.0.2.5 | Ubuntu 18.04 | 1Go | | + | | PuppetSlave01 | slave01.i2tch.loc | 10.0.2.68 | Ubuntu 18.04 | 2048 Mo | |
| - | | PuppetSlave02 | slave02.i2tch.loc | 10.0.2.6 | CentOS 7 | 1Go | | + | | PuppetSlave02 | slave02.i2tch.loc | 10.0.2.69 | CentOS 7 | 1024 Mo | |
| Les noms d' | Les noms d' | ||
| Ligne 26: | Ligne 47: | ||
| | root | fenestros | | | root | fenestros | | ||
| - | Créez les redirections de ports dans le réseau NAT **NatNetwork** de VirtualBox (Fichier > Paramètres > Réseau > NatNetwork > Redirection de ports) selon le tableau suivant : | + | ====Configuration du Fuseau d' |
| - | + | ||
| - | ^ Nom ^ Protocole ^ IP hôte ^ Port hôte ^ IP invité ^ Port invité ^ | + | |
| - | | ssh01 | TCP | 127.0.0.1 | 2422 | 10.0.2.4 | 22 | | + | |
| - | | ssh02 | TCP | 127.0.0.1 | 2522 | 10.0.2.5 | 22 | | + | |
| - | | ssh03 | TCP | 127.0.0.1 | 2622 | 10.0.2.6 | 22 | | + | |
| - | + | ||
| - | + | ||
| - | ====Connexion à vos Machines Virtuelles==== | + | |
| - | + | ||
| - | Vous devez vous connecter aux machines virtuelles de la façon suivante : | + | |
| - | + | ||
| - | ===MAC et Linux=== | + | |
| - | + | ||
| - | Ouvrez un terminal et tapez la commande suivante pour la machine **PuppetMaster** : | + | |
| - | + | ||
| - | < | + | |
| - | $ ssh -l trainee localhost -p 2422 | + | |
| - | </ | + | |
| - | + | ||
| - | Ouvrez un autre terminal et tapez la commande suivante pour la machine **PuppetSlave01** : | + | |
| - | + | ||
| - | < | + | |
| - | $ ssh -l trainee localhost -p 2522 | + | |
| - | </ | + | |
| - | + | ||
| - | Ouvrez un autre terminal et tapez la commande suivante pour la machine **PuppetSlave02** : | + | |
| - | + | ||
| - | < | + | |
| - | $ ssh -l trainee localhost -p 2622 | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | ===Windows=== | + | |
| - | + | ||
| - | Ouvrez un autre terminal et tapez la commande suivante pour la machine **PuppetMaster** : | + | |
| - | + | ||
| - | * Host Name --> localhost | + | |
| - | * Port --> 2422 | + | |
| - | + | ||
| - | Ouvrez un autre terminal et tapez la commande suivante pour la machine **PuppetSlave01** : | + | |
| - | + | ||
| - | * Host Name --> localhost | + | |
| - | * Port --> 2522 | + | |
| - | + | ||
| - | Ouvrez un autre terminal et tapez la commande suivante pour la machine **PuppetSlave02** : | + | |
| - | + | ||
| - | * Host Name --> localhost | + | |
| - | * Port --> 2622 | + | |
| - | + | ||
| - | ====Puppet en mode Agent/ | + | |
| - | + | ||
| - | ===Préparation=== | + | |
| Configurez les trois machines virtuelles pour qu' | Configurez les trois machines virtuelles pour qu' | ||
| Ligne 88: | Ligne 57: | ||
| Current default time zone: ' | Current default time zone: ' | ||
| - | Local time is now: Wed Mar 13 14:31:18 CET 2019. | + | Local time is now: Wed Feb 12 14:11:40 CET 2020. |
| - | Universal Time is now: Wed Mar 13 13:31:18 UTC 2019. | + | Universal Time is now: Wed Feb 12 13:11:40 UTC 2020. |
| </ | </ | ||
| Ligne 98: | Ligne 67: | ||
| Current default time zone: ' | Current default time zone: ' | ||
| - | Local time is now: Wed Mar 13 14:31:45 CET 2019. | + | Local time is now: Wed Feb 12 14:12:21 CET 2020. |
| - | Universal Time is now: Wed Mar 13 13:31:45 UTC 2019. | + | Universal Time is now: Wed Feb 12 13:12:21 UTC 2020. |
| </ | </ | ||
| < | < | ||
| + | [trainee@slave02 ~]$ su - | ||
| + | Mot de passe : fenestros | ||
| + | Dernière connexion : mercredi 13 mars 2019 à 12:55:24 CET sur tty1 | ||
| [root@slave02 ~]# timedatectl set-timezone ' | [root@slave02 ~]# timedatectl set-timezone ' | ||
| [root@slave02 ~]# date | [root@slave02 ~]# date | ||
| - | Wed 13 Mar 14:34:03 CET 2019 | + | Wed 12 Feb 14:12:51 CET 2020 |
| </ | </ | ||
| - | ===Installer puppetserver=== | + | ====Désactiver SELinux dans puppetslave02==== |
| + | |||
| + | < | ||
| + | [root@slave02 ~]# vi / | ||
| + | [root@slave02 ~]# cat / | ||
| + | |||
| + | # This file controls the state of SELinux on the system. | ||
| + | # SELINUX= can take one of these three values: | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | SELINUX=permissive | ||
| + | # SELINUXTYPE= can take one of three two values: | ||
| + | # | ||
| + | # | ||
| + | # mls - Multi Level Security protection. | ||
| + | SELINUXTYPE=targeted | ||
| + | |||
| + | |||
| + | [root@slave02 ~]# setenforce permissive | ||
| + | </ | ||
| + | |||
| + | =====LAB #1 - Installer et Configurer Puppet Server===== | ||
| + | |||
| + | ====Installer puppetserver==== | ||
| Installez Puppet dans la machine virtuelle **PuppetMaster** : | Installez Puppet dans la machine virtuelle **PuppetMaster** : | ||
| Ligne 114: | Ligne 110: | ||
| < | < | ||
| root@master: | root@master: | ||
| - | --2019-03-13 14:35:40-- https:// | + | --2020-02-12 14:13:20-- https:// |
| - | Resolving apt.puppetlabs.com (apt.puppetlabs.com)... 13.32.210.13, 13.32.210.105, 13.32.210.97, ... | + | Resolving apt.puppetlabs.com (apt.puppetlabs.com)... 13.225.38.129, 13.225.38.76, 13.225.38.45, ... |
| - | Connecting to apt.puppetlabs.com (apt.puppetlabs.com)|13.32.210.13|:443... connected. | + | Connecting to apt.puppetlabs.com (apt.puppetlabs.com)|13.225.38.129|:443... connected. |
| HTTP request sent, awaiting response... 200 OK | HTTP request sent, awaiting response... 200 OK | ||
| - | Length: | + | Length: |
| Saving to: ‘puppet-release-bionic.deb’ | Saving to: ‘puppet-release-bionic.deb’ | ||
| - | puppet-release-bion 100%[===================> | + | puppet-release-bionic.deb |
| - | 2019-03-13 14:35:40 (78.9 MB/s) - ‘puppet-release-bionic.deb’ saved [9672/9672] | + | 2020-02-12 14:13:21 (346 MB/s) - ‘puppet-release-bionic.deb’ saved [11724/11724] |
| root@master: | root@master: | ||
| Ligne 129: | Ligne 125: | ||
| (Reading database ... 128539 files and directories currently installed.) | (Reading database ... 128539 files and directories currently installed.) | ||
| Preparing to unpack puppet-release-bionic.deb ... | Preparing to unpack puppet-release-bionic.deb ... | ||
| - | Unpacking puppet-release (1.0.0-3bionic) ... | + | Unpacking puppet-release (1.0.0-7bionic) ... |
| - | Setting up puppet-release (1.0.0-3bionic) ... | + | Setting up puppet-release (1.0.0-7bionic) ... |
| root@master: | root@master: | ||
| - | Ign:1 http://apt.puppetlabs.com bionic InRelease | + | Hit:1 http://us.archive.ubuntu.com/ |
| - | Get:2 http://apt.puppetlabs.com bionic | + | Hit:2 http://security.ubuntu.com/ |
| - | Get:3 http://security.ubuntu.com/ | + | Hit:3 http://us.archive.ubuntu.com/ |
| - | Hit:4 http:// | + | Hit:4 http:// |
| - | Get:5 http:// | + | Get:5 http:// |
| - | Get:6 http:// | + | Get:6 http:// |
| - | Get:7 http:// | + | Get:7 http:// |
| - | Get:8 http:// | + | Get:8 http:// |
| - | Get:9 http:// | + | Fetched |
| - | Get:10 http:// | + | |
| - | Fetched | + | |
| Reading package lists... Done | Reading package lists... Done | ||
| Building dependency tree | Building dependency tree | ||
| Reading state information... Done | Reading state information... Done | ||
| - | 474 packages can be upgraded. Run 'apt list --upgradable' | + | 624 packages can be upgraded. Run 'apt list --upgradable' |
| root@master: | root@master: | ||
| Ligne 154: | Ligne 148: | ||
| Reading state information... Done | Reading state information... Done | ||
| The following additional packages will be installed: | The following additional packages will be installed: | ||
| - | ca-certificates-java java-common net-tools openjdk-8-jre-headless | + | ca-certificates-java java-common net-tools openjdk-8-jre-headless puppet-agent |
| - | | + | |
| Suggested packages: | Suggested packages: | ||
| - | default-jre fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho | + | default-jre fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei fonts-wqy-zenhei |
| - | | + | |
| The following NEW packages will be installed: | The following NEW packages will be installed: | ||
| - | ca-certificates-java java-common net-tools openjdk-8-jre-headless | + | ca-certificates-java java-common net-tools openjdk-8-jre-headless puppet-agent puppetserver |
| - | | + | 0 upgraded, 6 newly installed, 0 to remove and 624 not upgraded. |
| - | 0 upgraded, 6 newly installed, 0 to remove and 474 not upgraded. | + | Need to get 110 MB of archives. |
| - | Need to get 124 MB of archives. | + | After this operation, |
| - | After this operation, | + | |
| Do you want to continue? [Y/n] y | Do you want to continue? [Y/n] y | ||
| </ | </ | ||
| - | ===Configurer | + | ====Configurer |
| Utilisez la commande **puppet config** pour définir la valeur de la variable **dns_alt_names** : | Utilisez la commande **puppet config** pour définir la valeur de la variable **dns_alt_names** : | ||
| Ligne 213: | Ligne 204: | ||
| Synchronizing state of puppetserver.service with SysV service script with / | Synchronizing state of puppetserver.service with SysV service script with / | ||
| Executing: / | Executing: / | ||
| + | |||
| root@master: | root@master: | ||
| - | root@master:~# systemctl status puppetserver | + | oot@master:~# systemctl status puppetserver.service |
| ● puppetserver.service - puppetserver Service | ● puppetserver.service - puppetserver Service | ||
| - | | + | |
| - | | + | |
| - | Process: | + | Process: |
| - | Main PID: 818 (java) | + | Main PID: 838 (java) |
| - | Tasks: | + | Tasks: |
| | | ||
| - | | + | |
| - | Mar 13 14:57:54 master.i2tch.loc systemd[1]: Starting puppetserver Service... | + | Feb 12 14:42:34 master.i2tch.loc systemd[1]: Starting puppetserver Service... |
| - | Mar 13 14:59:31 master.i2tch.loc systemd[1]: Started puppetserver Service. | + | Feb 12 14:43:22 master.i2tch.loc systemd[1]: Started puppetserver Service. |
| - | lines 1-11/11 (END) | + | |
| </ | </ | ||
| - | ===Installer puppet-agent sur les Machines Virtuelles Esclaves=== | + | Dernièrement, |
| + | |||
| + | < | ||
| + | root@master: | ||
| + | root@master: | ||
| + | 127.0.0.1 | ||
| + | 127.0.1.1 | ||
| + | 10.0.2.59 | ||
| + | 10.0.2.68 | ||
| + | 10.0.2.69 | ||
| + | |||
| + | # The following lines are desirable for IPv6 capable hosts | ||
| + | ::1 | ||
| + | fe00::0 ip6-localnet | ||
| + | ff00::0 ip6-mcastprefix | ||
| + | ff02::1 ip6-allnodes | ||
| + | ff02::2 ip6-allrouters | ||
| + | </ | ||
| + | |||
| + | =====LAB #2 - Installer | ||
| + | |||
| + | ====Installer puppet-agent==== | ||
| < | < | ||
| root@slave01: | root@slave01: | ||
| - | --2019-03-13 15:00:33-- https:// | + | --2020-02-12 14:27:25-- https:// |
| - | Resolving apt.puppetlabs.com (apt.puppetlabs.com)... | + | Resolving apt.puppetlabs.com (apt.puppetlabs.com)... |
| - | Connecting to apt.puppetlabs.com (apt.puppetlabs.com)|13.32.210.13|:443... connected. | + | Connecting to apt.puppetlabs.com (apt.puppetlabs.com)|143.204.226.21|:443... connected. |
| HTTP request sent, awaiting response... 200 OK | HTTP request sent, awaiting response... 200 OK | ||
| - | Length: | + | Length: |
| Saving to: ‘puppet-release-bionic.deb’ | Saving to: ‘puppet-release-bionic.deb’ | ||
| - | puppet-release-bionic.deb | + | puppet-release-bionic.deb |
| - | 2019-03-13 15:00:33 (114 MB/s) - ‘puppet-release-bionic.deb’ saved [9672/9672] | + | 2020-02-12 14:27:26 (97.4 MB/s) - ‘puppet-release-bionic.deb’ saved [11724/11724] |
| root@slave01: | root@slave01: | ||
| Ligne 248: | Ligne 260: | ||
| (Reading database ... 128539 files and directories currently installed.) | (Reading database ... 128539 files and directories currently installed.) | ||
| Preparing to unpack puppet-release-bionic.deb ... | Preparing to unpack puppet-release-bionic.deb ... | ||
| - | Unpacking puppet-release (1.0.0-3bionic) ... | + | Unpacking puppet-release (1.0.0-7bionic) ... |
| - | Setting up puppet-release (1.0.0-3bionic) ... | + | Setting up puppet-release (1.0.0-7bionic) ... |
| - | root@slave01: | + | |
| root@slave01: | root@slave01: | ||
| - | Get:1 http:// | + | Hit:1 http:// |
| - | Ign:2 http://apt.puppetlabs.com bionic InRelease | + | Hit:2 http://us.archive.ubuntu.com/ |
| - | Get:3 http:// | + | Get:3 http:// |
| - | Hit:4 http:// | + | Hit:4 http:// |
| - | Get:5 http:// | + | Hit:5 http:// |
| - | Get:6 http:// | + | Get:6 http:// |
| - | Get:7 http:// | + | Get:7 http:// |
| - | Get:8 http:// | + | Get:8 http:// |
| - | Get:9 http:// | + | Fetched |
| - | Get:10 http:// | + | |
| - | Get:11 http:// | + | |
| - | Get:12 http:// | + | |
| - | Get:13 http:// | + | |
| - | Get:14 http:// | + | |
| - | Fetched | + | |
| Reading package lists... Done | Reading package lists... Done | ||
| Building dependency tree | Building dependency tree | ||
| Reading state information... Done | Reading state information... Done | ||
| - | 474 packages can be upgraded. Run 'apt list --upgradable' | + | 619 packages can be upgraded. Run 'apt list --upgradable' |
| - | root@slave01: | + | |
| root@slave01: | root@slave01: | ||
| Reading package lists... Done | Reading package lists... Done | ||
| Ligne 278: | Ligne 284: | ||
| The following NEW packages will be installed: | The following NEW packages will be installed: | ||
| puppet-agent | puppet-agent | ||
| - | 0 upgraded, 1 newly installed, 0 to remove and 474 not upgraded. | + | 0 upgraded, 1 newly installed, 0 to remove and 619 not upgraded. |
| - | Need to get 18.8 MB of archives. | + | Need to get 20.2 MB of archives. |
| - | After this operation, | + | After this operation, |
| - | Get:1 http:// | + | Get:1 http:// |
| - | Fetched | + | Fetched |
| Selecting previously unselected package puppet-agent. | Selecting previously unselected package puppet-agent. | ||
| (Reading database ... 128544 files and directories currently installed.) | (Reading database ... 128544 files and directories currently installed.) | ||
| - | Preparing to unpack .../ | + | Preparing to unpack .../ |
| - | Unpacking puppet-agent (6.3.0-1bionic) ... | + | Unpacking puppet-agent (6.12.0-1bionic) ... |
| - | Setting up puppet-agent (6.3.0-1bionic) ... | + | Setting up puppet-agent (6.12.0-1bionic) ... |
| Created symlink / | Created symlink / | ||
| Created symlink / | Created symlink / | ||
| Ligne 297: | Ligne 303: | ||
| [root@slave02 ~]# rpm -Uvh https:// | [root@slave02 ~]# rpm -Uvh https:// | ||
| Retrieving https:// | Retrieving https:// | ||
| - | warning: / | + | warning: / |
| Preparing... | Preparing... | ||
| Updating / installing... | Updating / installing... | ||
| | | ||
| - | [root@slave02 ~]# | + | |
| [root@slave02 ~]# yum install puppet-agent | [root@slave02 ~]# yum install puppet-agent | ||
| Loaded plugins: fastestmirror, | Loaded plugins: fastestmirror, | ||
| Determining fastest mirrors | Determining fastest mirrors | ||
| - | * base: rep-centos-fr.upress.io | + | * base: mirrors.ircam.fr |
| - | * extras: | + | * extras: |
| - | * updates: | + | * updates: |
| base | 3.6 kB 00: | base | 3.6 kB 00: | ||
| - | extras | + | extras |
| puppet | puppet | ||
| - | updates | + | updates |
| - | (1/3): extras/ | + | (1/5): base/ |
| - | (2/3): puppet/ | + | (2/5): extras/ |
| - | (3/3): updates/ | + | (3/5): puppet/ |
| + | (4/5): base/ | ||
| + | (5/5): updates/ | ||
| Resolving Dependencies | Resolving Dependencies | ||
| --> Running transaction check | --> Running transaction check | ||
| - | ---> Package puppet-agent.x86_64 0:6.3.0-1.el7 will be installed | + | ---> Package puppet-agent.x86_64 0:6.12.0-1.el7 will be installed |
| --> Finished Dependency Resolution | --> Finished Dependency Resolution | ||
| Ligne 323: | Ligne 331: | ||
| ============================================================================================================================== | ============================================================================================================================== | ||
| - | | + | |
| ============================================================================================================================== | ============================================================================================================================== | ||
| Installing: | Installing: | ||
| - | | + | |
| Transaction Summary | Transaction Summary | ||
| Ligne 332: | Ligne 340: | ||
| Install | Install | ||
| - | Total download size: 22 M | + | Total download size: 23 M |
| - | Installed size: 22 M | + | Installed size: 23 M |
| Is this ok [y/d/N]: y | Is this ok [y/d/N]: y | ||
| </ | </ | ||
| - | ===Configurer puppet-agent | + | ====Configurer puppet-agent==== |
| - | Utilisez la commande **puppet config** sur chaque | + | Utilisez la commande **puppet config** sur chaque |
| < | < | ||
| Ligne 378: | Ligne 386: | ||
| root@master: | root@master: | ||
| Requested Certificates: | Requested Certificates: | ||
| - | slave01.i2tch.loc | + | slave01.i2tch.loc |
| - | slave02.i2tch.loc | + | slave02.i2tch.loc |
| </ | </ | ||
| Validez les certificats en attente : | Validez les certificats en attente : | ||
| + | |||
| + | < | ||
| + | root@master: | ||
| + | Successfully signed certificate request for slave01.i2tch.loc | ||
| + | Successfully signed certificate request for slave02.i2tch.loc | ||
| + | </ | ||
| + | |||
| + | Si vous ne voyez pas de certificats ou seulement un certificat sur deux, arrêtez le service puppet sur le(s) noeud(s) concerné(s) : | ||
| + | |||
| + | < | ||
| + | root@slave01: | ||
| + | root@slave02: | ||
| + | </ | ||
| + | |||
| + | Supprimez les certificats existants : | ||
| + | |||
| + | < | ||
| + | root@master: | ||
| + | root@master: | ||
| + | </ | ||
| + | |||
| + | Lancez ensuite les commandes suivantes dans les deux esclaves : | ||
| + | |||
| + | < | ||
| + | root@slave01: | ||
| + | root@slave01: | ||
| + | Info: Creating a new RSA SSL key for slave01.i2tch.loc | ||
| + | Info: csr_attributes file loading from / | ||
| + | Info: Creating a new SSL certificate request for slave01.i2tch.loc | ||
| + | Info: Certificate Request fingerprint (SHA256): 81: | ||
| + | Info: Certificate for slave01.i2tch.loc has not been signed yet | ||
| + | Couldn' | ||
| + | Exiting now because the waitforcert setting is set to 0. | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | [root@slave02 ~]# rm -rf / | ||
| + | [root@slave02 ~]# puppet agent --test | ||
| + | Info: Creating a new RSA SSL key for slave02.i2tch.loc | ||
| + | Info: csr_attributes file loading from / | ||
| + | Info: Creating a new SSL certificate request for slave02.i2tch.loc | ||
| + | Info: Certificate Request fingerprint (SHA256): EF: | ||
| + | Info: Certificate for slave02.i2tch.loc has not been signed yet | ||
| + | Couldn' | ||
| + | Exiting now because the waitforcert setting is set to 0. | ||
| + | </ | ||
| + | |||
| + | Retournez ensuite à la machine virtuelle **master** et validez les certificats en attente : | ||
| < | < | ||
| Ligne 394: | Ligne 450: | ||
| < | < | ||
| root@slave01: | root@slave01: | ||
| + | Info: csr_attributes file loading from / | ||
| + | Info: Creating a new SSL certificate request for slave01.i2tch.loc | ||
| + | Info: Certificate Request fingerprint (SHA256): 81: | ||
| + | Info: Downloaded certificate for slave01.i2tch.loc from https:// | ||
| Info: Using configured environment ' | Info: Using configured environment ' | ||
| Info: Retrieving pluginfacts | Info: Retrieving pluginfacts | ||
| Ligne 399: | Ligne 459: | ||
| Info: Retrieving locales | Info: Retrieving locales | ||
| Info: Caching catalog for slave01.i2tch.loc | Info: Caching catalog for slave01.i2tch.loc | ||
| - | Info: Applying configuration version '1552488579' | + | Info: Applying configuration version '1581520502' |
| - | Notice: Applied catalog in 0.02 seconds | + | Notice: Applied catalog in 0.01 seconds |
| </ | </ | ||
| Ligne 410: | Ligne 470: | ||
| Info: Retrieving locales | Info: Retrieving locales | ||
| Info: Caching catalog for slave02.i2tch.loc | Info: Caching catalog for slave02.i2tch.loc | ||
| - | Info: Applying configuration version '1552488587' | + | Info: Applying configuration version '1581520616' |
| - | Notice: Applied catalog in 0.01 seconds | + | Notice: Applied catalog in 0.03 seconds |
| </ | </ | ||
| - | ===Sécuriser l' | + | =====LAB #3 - Création d'un Utilisateur===== |
| - | + | ||
| - | ==Création d'un Utilisateur== | + | |
| Placez-vous dans le répertoire **/ | Placez-vous dans le répertoire **/ | ||
| Ligne 429: | Ligne 487: | ||
| < | < | ||
| root@master:/ | root@master:/ | ||
| + | |||
| + | SNAPSHOT1 | ||
| + | |||
| root@master:/ | root@master:/ | ||
| </ | </ | ||
| Ligne 437: | Ligne 498: | ||
| root@master:/ | root@master:/ | ||
| root@master:/ | root@master:/ | ||
| - | root@master:/ | + | root@master:/ |
| class accounts { | class accounts { | ||
| Ligne 480: | Ligne 541: | ||
| Password: toto | Password: toto | ||
| Verifying - Password: toto | Verifying - Password: toto | ||
| - | $1$WvExmQIP$bg4DwtAR2AMORYaP5iTsI/ | + | $1$1lyYx3kO$sb0z34V28E7b7kYQb3Wjz. |
| - | root@master:/ | + | |
| </ | </ | ||
| Ligne 506: | Ligne 566: | ||
| gid => ' | gid => ' | ||
| groups | groups | ||
| - | password | + | password |
| } | } | ||
| Ligne 536: | Ligne 596: | ||
| < | < | ||
| root@master:/ | root@master:/ | ||
| - | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.11 seconds | + | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.10 seconds |
| Notice: / | Notice: / | ||
| Notice: Class[Accounts:: | Notice: Class[Accounts:: | ||
| - | Notice: / | + | Notice: / |
| Notice: Class[Accounts]: | Notice: Class[Accounts]: | ||
| Notice: Stage[main]: | Notice: Stage[main]: | ||
| - | Notice: Applied catalog in 0.08 seconds | + | Notice: Applied catalog in 0.39 seconds |
| </ | </ | ||
| Ligne 549: | Ligne 609: | ||
| < | < | ||
| root@master:/ | root@master:/ | ||
| - | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.02 seconds | + | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.04 seconds |
| Notice: / | Notice: / | ||
| - | Notice: / | + | Notice: / |
| - | Notice: Applied catalog in 0.53 seconds | + | Notice: Applied catalog in 0.37 seconds |
| </ | </ | ||
| Ligne 558: | Ligne 618: | ||
| < | < | ||
| + | trainee@traineeXX: | ||
| + | toto@localhost' | ||
| Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-29-generic x86_64) | Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-29-generic x86_64) | ||
| Ligne 569: | Ligne 631: | ||
| | | ||
| - | 323 packages can be updated. | + | 636 packages can be updated. |
| - | 0 updates are security updates. | + | 380 updates are security updates. |
| - | *** System restart required *** | ||
| The programs included with the Ubuntu system are free software; | The programs included with the Ubuntu system are free software; | ||
| the exact distribution terms for each program are described in the | the exact distribution terms for each program are described in the | ||
| individual files in / | individual files in / | ||
| - | de> | + | |
| Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by | Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by | ||
| applicable law. | applicable law. | ||
| Ligne 587: | Ligne 648: | ||
| </ | </ | ||
| - | ==Configuration de ssh== | + | =====LAB #4 - Configuration de ssh===== |
| Naviguez vers le répertoire **/ | Naviguez vers le répertoire **/ | ||
| Ligne 596: | Ligne 657: | ||
| </ | </ | ||
| - | Copiez le fichier **/ | + | Copiez le fichier **/ |
| < | < | ||
| - | toto@master:/ | + | toto@master:/ |
| [sudo] password for toto: toto | [sudo] password for toto: toto | ||
| </ | </ | ||
| Ligne 607: | Ligne 668: | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| - | toto@master:/ | + | toto@master:/ |
| ... | ... | ||
| # Authentication: | # Authentication: | ||
| Ligne 633: | Ligne 694: | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| - | [sudo] password for toto: toto | ||
| toto@master:/ | toto@master:/ | ||
| class accounts:: | class accounts:: | ||
| Ligne 679: | Ligne 739: | ||
| gid => ' | gid => ' | ||
| groups | groups | ||
| - | password | + | password |
| } | } | ||
| Ligne 685: | Ligne 745: | ||
| </ | </ | ||
| - | Testez ensuite la syntaxe | + | Testez ensuite la syntaxe |
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| toto@master:/ | toto@master:/ | ||
| + | toto@master:/ | ||
| + | toto@master:/ | ||
| + | </ | ||
| + | |||
| + | Naviguez vers le répertoire **/ | ||
| + | |||
| + | < | ||
| + | toto@master:/ | ||
| + | toto@master:/ | ||
| + | Reading package lists... Done | ||
| + | Building dependency tree | ||
| + | Reading state information... Done | ||
| + | The following NEW packages will be installed: | ||
| + | tree | ||
| + | 0 upgraded, 1 newly installed, 0 to remove and 574 not upgraded. | ||
| + | Need to get 40.7 kB of archives. | ||
| + | After this operation, 105 kB of additional disk space will be used. | ||
| + | Get:1 http:// | ||
| + | Fetched 40.7 kB in 1s (72.3 kB/s) | ||
| + | Selecting previously unselected package tree. | ||
| + | (Reading database ... 147924 files and directories currently installed.) | ||
| + | Preparing to unpack .../ | ||
| + | Unpacking tree (1.7.0-5) ... | ||
| + | Setting up tree (1.7.0-5) ... | ||
| + | Processing triggers for man-db (2.8.3-2) ... | ||
| + | </ | ||
| + | |||
| + | Vérifiez l' | ||
| + | |||
| + | < | ||
| + | toto@master:/ | ||
| + | . | ||
| + | ├── examples | ||
| + | │ └── init.pp | ||
| + | ├── files | ||
| + | │ └── sshd_config | ||
| + | ├── manifests | ||
| + | │ ├── groups.pp | ||
| + | │ ├── init.pp | ||
| + | │ └── ssh.pp | ||
| + | └── templates | ||
| + | |||
| + | 4 directories, | ||
| + | </ | ||
| + | |||
| + | Naviguez vers le répertoire **/ | ||
| + | |||
| + | < | ||
| + | toto@master:/ | ||
| </ | </ | ||
| Ligne 696: | Ligne 805: | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| - | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.39 seconds | + | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.24 seconds |
| - | Notice: / | + | Notice: / |
| Notice: / | Notice: / | ||
| Notice: Class[Accounts:: | Notice: Class[Accounts:: | ||
| Notice: Stage[main]: | Notice: Stage[main]: | ||
| - | Notice: Applied catalog in 0.11 seconds | + | Notice: Applied catalog in 0.03 seconds |
| </ | </ | ||
| Ligne 708: | Ligne 817: | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| - | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.28 seconds | + | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.25 seconds |
| - | Notice: / | + | Notice: / |
| Notice: / | Notice: / | ||
| - | Notice: Applied catalog in 0.18 seconds | + | Notice: Applied catalog in 0.09 seconds |
| </ | </ | ||
| - | ==Configuration d'IP Tables== | + | =====LAB #5 - Configuration d'IP Tables===== |
| Installez le paquet **iptables-persistent** ou **iptables-services** dans chaque machine virtuelle en fonction de la distribution : | Installez le paquet **iptables-persistent** ou **iptables-services** dans chaque machine virtuelle en fonction de la distribution : | ||
| Ligne 720: | Ligne 829: | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| - | toto@master: | ||
| - | [sudo] password for toto: toto | ||
| toto@master: | toto@master: | ||
| </ | </ | ||
| < | < | ||
| - | trainee@slave01: | ||
| - | Password: fenestros | ||
| - | root@slave01: | ||
| root@slave01: | root@slave01: | ||
| </ | </ | ||
| < | < | ||
| - | [trainee@slave02 ~]$ su - | ||
| - | Mot de passe : | ||
| - | Dernière connexion : mercredi 13 mars 2019 à 16:30:58 CET sur pts/0 | ||
| [root@slave02 ~]# systemctl stop firewalld && systemctl disable firewalld | [root@slave02 ~]# systemctl stop firewalld && systemctl disable firewalld | ||
| Removed symlink / | Removed symlink / | ||
| Ligne 742: | Ligne 843: | ||
| </ | </ | ||
| - | Installez le module Puppet **puppetlabs-firewall** dans la machine virtuelle **master** : | + | Installez le module Puppet **puppetlabs-firewall** dans la machine virtuelle **puppetmaster** : |
| < | < | ||
| Ligne 750: | Ligne 851: | ||
| Notice: Installing -- do not interrupt ... | Notice: Installing -- do not interrupt ... | ||
| / | / | ||
| - | └─┬ puppetlabs-firewall (v1.15.2) | + | └─┬ puppetlabs-firewall (v2.2.0) |
| - | └── puppetlabs-stdlib (v5.2.0) | + | └── puppetlabs-stdlib (v6.2.0) |
| </ | </ | ||
| - | Naviguez maintenant vers le répertoire **/ | + | Naviguez maintenant vers le répertoire **/ |
| < | < | ||
| Ligne 827: | Ligne 928: | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| - | [sudo] password for toto: toto | ||
| toto@master:/ | toto@master:/ | ||
| class firewall:: | class firewall:: | ||
| Ligne 844: | Ligne 944: | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| + | toto@master:/ | ||
| toto@master:/ | toto@master:/ | ||
| + | toto@master:/ | ||
| + | </ | ||
| + | |||
| + | Vérifiez l' | ||
| + | |||
| + | < | ||
| + | toto@master:/ | ||
| + | . | ||
| + | ├── init.pp | ||
| + | ├── linux | ||
| + | │ ├── archlinux.pp | ||
| + | │ ├── debian.pp | ||
| + | │ ├── gentoo.pp | ||
| + | │ └── redhat.pp | ||
| + | ├── linux.pp | ||
| + | ├── params.pp | ||
| + | ├── post.pp | ||
| + | └── pre.pp | ||
| + | |||
| + | 1 directory, 9 files | ||
| </ | </ | ||
| Ligne 854: | Ligne 975: | ||
| </ | </ | ||
| - | Créez le fichier **site.pp** qui pilote l' | + | Créez le fichier **site.pp** qui pilote l' |
| < | < | ||
| Ligne 898: | Ligne 1019: | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| - | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.13 seconds | + | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.14 seconds |
| Notice: / | Notice: / | ||
| Notice: / | Notice: / | ||
| Ligne 913: | Ligne 1034: | ||
| Notice: Class[Firewall:: | Notice: Class[Firewall:: | ||
| Notice: Stage[main]: | Notice: Stage[main]: | ||
| - | Notice: Applied catalog in 0.22 seconds | + | Notice: Applied catalog in 0.17 seconds |
| </ | </ | ||
| Ligne 930: | Ligne 1051: | ||
| Notice: / | Notice: / | ||
| Notice: / | Notice: / | ||
| - | Notice: Applied catalog in 1.56 seconds | + | Notice: Applied catalog in 0.98 seconds |
| </ | </ | ||
| Ligne 956: | Ligne 1077: | ||
| </ | </ | ||
| - | Modifiez le manifest **site.pp** pour inclure les sections pour déclarer les classes, les modules et les ressources à appliquer à **node01.i2tch.loc** et à **node02.i2tch.loc** : | + | Modifiez le manifest **site.pp** pour inclure les sections pour déclarer les classes, les modules et les ressources à appliquer à **slave01.i2tch.loc** et à **slave02.i2tch.loc** : |
| < | < | ||
| Ligne 1023: | Ligne 1144: | ||
| </ | </ | ||
| - | ===Exécuter l' | + | ====Exécuter l' |
| - | Connectez-vous à la machine virtuelle **node01.i2tch.loc** en tant que **root** : | + | Connectez-vous à la machine virtuelle **slave01.i2tch.loc** en ssh et devenez |
| < | < | ||
| - | hnorris@docker: | ||
| - | trainee@localhost' | ||
| - | Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-29-generic x86_64) | ||
| - | |||
| - | * Documentation: | ||
| - | * Management: | ||
| - | * Support: | ||
| - | |||
| - | |||
| - | * Canonical Livepatch is available for installation. | ||
| - | - Reduce system reboots and improve kernel security. Activate at: | ||
| - | | ||
| - | |||
| - | 330 packages can be updated. | ||
| - | 8 updates are security updates. | ||
| - | |||
| - | *** System restart required *** | ||
| - | Last login: Tue Apr 2 11:03:28 2019 from 10.0.2.2 | ||
| trainee@slave01: | trainee@slave01: | ||
| Password: fenestros | Password: fenestros | ||
| Ligne 1054: | Ligne 1157: | ||
| < | < | ||
| root@slave01: | root@slave01: | ||
| - | Info: Using configured environment | + | ... |
| - | Info: Retrieving pluginfacts | + | Notice: / |
| - | Info: Retrieving plugin | + | Notice: / |
| - | Info: Retrieving locales | + | Notice: / |
| - | Info: Loading facts | + | Notice: / |
| - | Info: Caching catalog for slave01.i2tch.loc | + | Notice: / |
| - | Info: Applying configuration version ' | + | Notice: / |
| - | Notice: Applied catalog in 0.25 seconds | + | Notice: / |
| + | Notice: / | ||
| + | Notice: / | ||
| + | Notice: / | ||
| + | Notice: Applied catalog in 1.78 seconds | ||
| </ | </ | ||
| Ligne 1074: | Ligne 1181: | ||
| </ | </ | ||
| - | Re-connectez-vous en tant que l' | + | Re-connectez-vous |
| < | < | ||
| - | hnorris@docker: | + | ... |
| - | toto@localhost' | + | |
| Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-29-generic x86_64) | Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-29-generic x86_64) | ||
| Ligne 1131: | Ligne 1237: | ||
| </ | </ | ||
| - | ===Exécuter l' | + | ====Exécuter l' |
| - | Connectez-vous à la machine virtuelle **node02.i2tch.loc** en tant que **root** : | + | Connectez-vous à la machine virtuelle **slave02.i2tch.loc** en ssh et devenez |
| < | < | ||
| - | hnorris@docker: | ||
| - | trainee@localhost' | ||
| - | Last login: Wed Mar 13 16:30:44 2019 from gateway | ||
| [trainee@slave02 ~]$ su - | [trainee@slave02 ~]$ su - | ||
| Mot de passe : fenestros | Mot de passe : fenestros | ||
| Ligne 1149: | Ligne 1252: | ||
| < | < | ||
| [root@slave02 ~]# / | [root@slave02 ~]# / | ||
| - | Info: Using configured environment ' | + | ... |
| - | Info: Retrieving pluginfacts | + | Notice: / |
| - | Info: Retrieving plugin | + | Notice: / |
| - | Info: Retrieving locales | + | Notice: / |
| - | Info: Loading facts | + | Notice: / |
| - | Info: Caching catalog for slave02.i2tch.loc | + | Notice: / |
| - | Info: Applying configuration version ' | + | Notice: / |
| - | Notice: Applied catalog in 0.22 seconds | + | Notice: / |
| + | Notice: / | ||
| + | Notice: Applied catalog in 0.97 seconds | ||
| </ | </ | ||
| Ligne 1169: | Ligne 1274: | ||
| </ | </ | ||
| - | Re-connectez-vous en tant que l' | + | Re-connectez-vous |
| < | < | ||
| - | hnorris@docker: | + | -bash-4.2$ sudo iptables -L |
| - | toto@localhost' | + | |
| - | [toto@slave02 ~]$ | + | |
| - | </ | + | |
| - | + | ||
| - | Vérifiez que les règles du pare-feu ont été appliquées : | + | |
| - | + | ||
| - | < | + | |
| - | [toto@slave02 ~]$ sudo iptables -L | + | |
| Nous espérons que vous avez reçu de votre administrateur système local les consignes traditionnelles. Généralement, | Nous espérons que vous avez reçu de votre administrateur système local les consignes traditionnelles. Généralement, | ||
| Ligne 1188: | Ligne 1285: | ||
| #3) De grands pouvoirs confèrent de grandes responsabilités. | #3) De grands pouvoirs confèrent de grandes responsabilités. | ||
| - | [sudo] Mot de passe de toto : | + | [sudo] Mot de passe de toto : toto |
| Chain INPUT (policy ACCEPT) | Chain INPUT (policy ACCEPT) | ||
| target | target | ||
| Ligne 1207: | Ligne 1304: | ||
| </ | </ | ||
| - | =====LAB #28 - Déployer Apache avec Puppet en mode Agent/ | + | =====LAB #6 - Déployer Apache avec Puppet en mode Agent/ |
| + | |||
| + | Le but ici est de créer un rôle contenant les fichiers suivants : | ||
| + | |||
| + | < | ||
| + | . | ||
| + | ├── examples | ||
| + | │ └── init.pp | ||
| + | ├── files | ||
| + | │ ├── apache2.conf | ||
| + | │ └── httpd.conf | ||
| + | ├── manifests | ||
| + | │ ├── init.pp | ||
| + | │ ├── params.pp | ||
| + | │ └── vhosts.pp | ||
| + | └── templates | ||
| + | ├── vhosts-deb.conf.erb | ||
| + | └── vhosts-rh.conf.erb | ||
| + | </ | ||
| ====Création du Rôle==== | ====Création du Rôle==== | ||
| - | Naviguez vers le répertoire **/ | + | Naviguez vers le répertoire **/ |
| < | < | ||
| - | toto@master:/ | + | toto@master:/ |
| + | toto@master: | ||
| toto@master:/ | toto@master:/ | ||
| - | [sudo] password for toto: toto | ||
| </ | </ | ||
| Ligne 1226: | Ligne 1341: | ||
| </ | </ | ||
| - | ====Création des Mainifests==== | + | ====Création des Manifests==== |
| Placez-vous dans le répertoire **/ | Placez-vous dans le répertoire **/ | ||
| Ligne 1269: | Ligne 1384: | ||
| * le paquet à installer est référencé par une variable **$apachename**, | * le paquet à installer est référencé par une variable **$apachename**, | ||
| * la variable $apachename est fixée par la classe **apache:: | * la variable $apachename est fixée par la classe **apache:: | ||
| - | * la ressource **file** utilise deux variables, **$conffile** et **$consource**, également fixées par la classe apache:: | + | * la ressource **file** utilise deux variables, **$conffile** et **$confsource**, également fixées par la classe apache:: |
| Créez ensuite le manifest **params.pp** pour définir la classe **apache:: | Créez ensuite le manifest **params.pp** pour définir la classe **apache:: | ||
| Ligne 1295: | Ligne 1410: | ||
| </ | </ | ||
| - | Les hôtes virtuels d' | + | Les hôtes virtuels d' |
| < | < | ||
| Ligne 1307: | Ligne 1422: | ||
| content | content | ||
| } | } | ||
| - | file { [ '/ | + | file { [ "/ |
| - | '/ | + | "/ |
| - | '/ | + | "/ |
| ensure | ensure | ||
| } | } | ||
| Ligne 1317: | Ligne 1432: | ||
| content | content | ||
| } | } | ||
| - | file { [ '/ | + | file { [ "/ |
| - | '/ | + | "/ |
| - | '/ | + | "/ |
| ensure | ensure | ||
| } | } | ||
| Ligne 1336: | Ligne 1451: | ||
| < | < | ||
| - | toto@master:/ | + | toto@master:/ |
| - | toto@master:/ | + | toto@master:/ |
| </ | </ | ||
| Ligne 1935: | Ligne 2050: | ||
| < | < | ||
| - | toto@master:/ | + | toto@master:/ |
| toto@master:/ | toto@master:/ | ||
| </ | </ | ||
| Ligne 1949: | Ligne 2064: | ||
| ServerAlias www.<%= @servername %> | ServerAlias www.<%= @servername %> | ||
| DocumentRoot / | DocumentRoot / | ||
| - | ErrorLog / | + | ErrorLog / |
| CustomLog / | CustomLog / | ||
| - | </Virtual Host> | + | </VirtualHost> |
| </ | </ | ||
| Ligne 1964: | Ligne 2079: | ||
| ServerAlias www.<%= @servername %> | ServerAlias www.<%= @servername %> | ||
| DocumentRoot / | DocumentRoot / | ||
| - | ErrorLog / | + | ErrorLog / |
| CustomLog / | CustomLog / | ||
| < | < | ||
| Require all granted | Require all granted | ||
| </ | </ | ||
| - | </Virtual Host> | + | </VirtualHost> |
| + | </ | ||
| + | |||
| + | Naviguez au répertoire **/ | ||
| + | |||
| + | < | ||
| + | toto@master:/ | ||
| + | toto@master:/ | ||
| + | . | ||
| + | ├── examples | ||
| + | ├── files | ||
| + | │ ├── apache2.conf | ||
| + | │ └── httpd.conf | ||
| + | ├── manifests | ||
| + | │ ├── init.pp | ||
| + | │ ├── params.pp | ||
| + | │ └── vhosts.pp | ||
| + | └── templates | ||
| + | ├── vhosts-deb.conf.erb | ||
| + | └── vhosts-rh.conf.erb | ||
| </ | </ | ||
| Ligne 1977: | Ligne 2111: | ||
| < | < | ||
| - | toto@master:/ | + | toto@master:/ |
| - | toto@master:/ | + | toto@master:/ |
| </ | </ | ||
| Ligne 1985: | Ligne 2119: | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| - | toto@master:/ | + | toto@master:/ |
| </ | </ | ||
| Ligne 1991: | Ligne 2125: | ||
| < | < | ||
| - | toto@master:/ | + | toto@master:/ |
| - | toto@master:/ | + | toto@master:/ |
| </ | </ | ||
| - | Créez le fichier **init.pp** pour définir les valeurs des deux variables **$serveremail** et **$servername** : | + | Créez le fichier **init.pp** pour définir les valeurs des deux variables **$adminemail** et **$servername** : |
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| toto@master:/ | toto@master:/ | ||
| - | $serveremail | + | $adminemail |
| $servername = ' | $servername = ' | ||
| Ligne 2007: | Ligne 2141: | ||
| </ | </ | ||
| - | Testez l'exécution | + | Naviguez au répertoire **/ |
| + | |||
| + | < | ||
| + | toto@master:/ | ||
| + | toto@master:/ | ||
| + | . | ||
| + | ├── examples | ||
| + | │ └── init.pp | ||
| + | ├── files | ||
| + | │ ├── apache2.conf | ||
| + | │ └── httpd.conf | ||
| + | ├── manifests | ||
| + | │ ├── init.pp | ||
| + | │ ├── params.pp | ||
| + | │ └── vhosts.pp | ||
| + | └── templates | ||
| + | ├── vhosts-deb.conf.erb | ||
| + | └── vhosts-rh.conf.erb | ||
| + | |||
| + | 4 directories, | ||
| + | </ | ||
| + | |||
| + | Retournez au répertoire **/ | ||
| + | |||
| + | < | ||
| + | toto@master:/ | ||
| + | </ | ||
| + | |||
| + | Testez l'application | ||
| < | < | ||
| toto@master:/ | toto@master:/ | ||
| - | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.10 seconds | + | Notice: Compiled catalog for master.i2tch.loc in environment production in 0.03 seconds |
| Notice: / | Notice: / | ||
| Notice: / | Notice: / | ||
| - | Notice: Class[Apache]: | + | Notice: / |
| + | Notice: Class[Apache]: | ||
| Notice: / | Notice: / | ||
| - | Notice: / | + | Notice: / |
| - | Notice: / | + | Notice: / |
| - | Notice: / | + | Notice: / |
| Notice: Class[Apache:: | Notice: Class[Apache:: | ||
| Notice: Stage[main]: | Notice: Stage[main]: | ||
| - | Notice: Applied catalog in 0.13 seconds | + | Notice: Applied catalog in 0.14 seconds |
| </ | </ | ||
| Ligne 2110: | Ligne 2273: | ||
| < | < | ||
| toto@slave01: | toto@slave01: | ||
| - | [sudo] password for toto: toto | + | [sudo] password for toto: |
| Info: Using configured environment ' | Info: Using configured environment ' | ||
| Info: Retrieving pluginfacts | Info: Retrieving pluginfacts | ||
| Ligne 2117: | Ligne 2280: | ||
| Info: Loading facts | Info: Loading facts | ||
| Info: Caching catalog for slave01.i2tch.loc | Info: Caching catalog for slave01.i2tch.loc | ||
| - | Info: Applying configuration version '1554230049' | + | Info: Applying configuration version '1582373993' |
| - | Notice: / | + | ... |
| - | Notice: / | + | Notice: Applied catalog in 24.16 seconds |
| - | --- / | + | |
| - | +++ / | + | |
| - | @@ -1,6 +1,6 @@ | + | |
| - | # This is the main Apache server configuration file. It contains the | + | |
| - | # configuration directives that give the server its instructions. | + | |
| - | -# See http:// | + | |
| - | +# See http:// | + | |
| - | # the directives and / | + | |
| - | # hints. | + | |
| - | # | + | |
| - | @@ -61,7 +61,7 @@ | + | |
| - | # | + | |
| - | # NOTE! If you intend to place this on an NFS (or otherwise network) | + | |
| - | # mounted filesystem then please read the Mutex documentation (available | + | |
| - | -# at < | + | |
| - | +# at < | + | |
| - | # you will save yourself a lot of trouble. | + | |
| - | # | + | |
| - | # Do NOT add a slash at the end of the directory path. | + | |
| - | @@ -71,13 +71,7 @@ | + | |
| - | # | + | |
| - | # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. | + | |
| - | # | + | |
| - | -#Mutex file: | + | |
| - | - | + | |
| - | -# | + | |
| - | -# The directory where shm and other runtime files will be stored. | + | |
| - | -# | + | |
| - | - | + | |
| - | -DefaultRuntimeDir ${APACHE_RUN_DIR} | + | |
| - | +Mutex file: | + | |
| - | + | ||
| - | # | + | |
| - | # PidFile: The file in which the server should record its process | + | |
| - | + | ||
| - | Info: Computing checksum on file / | + | |
| - | Info: / | + | |
| - | Notice: / | + | |
| - | Notice: / | + | |
| - | Notice: / | + | |
| - | Notice: / | + | |
| - | Notice: / | + | |
| - | Notice: Applied catalog in 27.66 seconds | + | |
| </ | </ | ||
| Ligne 2168: | Ligne 2288: | ||
| < | < | ||
| - | [toto@slave02 ~]$ sudo / | + | -bash-4.2$ sudo / |
| - | [sudo] Mot de passe de toto : toto | + | [sudo] Mot de passe de toto : |
| Info: Using configured environment ' | Info: Using configured environment ' | ||
| Info: Retrieving pluginfacts | Info: Retrieving pluginfacts | ||
| Ligne 2176: | Ligne 2296: | ||
| Info: Loading facts | Info: Loading facts | ||
| Info: Caching catalog for slave02.i2tch.loc | Info: Caching catalog for slave02.i2tch.loc | ||
| - | Info: Applying configuration version '1554230089' | + | Info: Applying configuration version '1582374068' |
| - | Notice: / | + | ... |
| - | Notice: / | + | Notice: Applied catalog in 39.38 seconds |
| - | --- / | + | |
| - | +++ / | + | |
| - | @@ -1,9 +1,9 @@ | + | |
| - | # | + | |
| - | # This is the main Apache HTTP server configuration file. It contains the | + | |
| - | # configuration directives that give the server its instructions. | + | |
| - | -# See < | + | |
| - | +# See < | + | |
| - | # In particular, see | + | |
| - | -# < | + | |
| - | +# < | + | |
| - | # for a discussion of each configuration directive. | + | |
| - | # | + | |
| - | # Do NOT simply read the instructions in here without understanding | + | |
| - | @@ -138,7 +138,7 @@ | + | |
| - | # doesn' | + | |
| - | # | + | |
| - | # The Options directive is both complicated and important. | + | |
| - | - # http:// | + | |
| - | + # http:// | + | |
| - | # for more information. | + | |
| - | # | + | |
| - | | + | |
| - | + | ||
| - | Info: Computing checksum on file / | + | |
| - | Info: / | + | |
| - | Notice: / | + | |
| - | Notice: / | + | |
| - | Notice: / | + | |
| - | Notice: / | + | |
| - | Notice: / | + | |
| - | Notice: Applied catalog in 141.82 seconds | + | |
| </ | </ | ||
| - | ---- | + | ----- |
| - | < | + | |
| - | <DIV ALIGN=" | + | Copyright © 2022 Hugh Norris. |
| - | Copyright © 2019 Hugh Norris. | + | |
| - | </ | + | |
| - | </ | + | |