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:part2 [2020/02/11 11:26] – admin | elearning:workbooks:debian:6:avance:l129:part2 [2022/06/20 17:08] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Version : **2020.01** | ||
- | |||
~~PDF: | ~~PDF: | ||
+ | |||
+ | Version : **2022.01** | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
Ligne 7: | Ligne 7: | ||
======DOF402 - Les Ressources Puppet====== | ======DOF402 - Les Ressources Puppet====== | ||
- | =====LAB #10 - La Ressource File===== | + | =====Contenu du Module===== |
+ | |||
+ | * **DOF402 - Les Ressources Puppet** | ||
+ | * Contenu du Module | ||
+ | * LAB #1 - La Ressource File | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * LAB #2 - La Ressource package | ||
+ | * L' | ||
+ | * Installation de Paquets | ||
+ | * Le Cas Spécifique des Gems de Ruby | ||
+ | * Suppression de Paquets | ||
+ | * LAB #3 - La Ressource service | ||
+ | * L' | ||
+ | * L' | ||
+ | * Les Attributs hasrestart et restart | ||
+ | * LAB #4 - La Ressource user | ||
+ | * Créer un Utilisateur | ||
+ | * LAB #5 - La Ressource cron | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * La Fonction fqdn_rand | ||
+ | * LAB #6 - La Ressource exec | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | * L' | ||
+ | |||
+ | =====LAB #1 - La Ressource File===== | ||
====L' | ====L' | ||
Ligne 41: | Ligne 81: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Notez que le contenu du fichier **/ | **Important** - Notez que le contenu du fichier **/ | ||
</ | </ | ||
- | L' | + | L' |
< | < | ||
Ligne 279: | Ligne 319: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Si le répertoire cible existe et il contient déjà des fichiers, Puppet ne fera rien. Ceci peut être modifié en utilisant l' | **Important** - Si le répertoire cible existe et il contient déjà des fichiers, Puppet ne fera rien. Ceci peut être modifié en utilisant l' | ||
</ | </ | ||
- | =====LAB #11 - La Ressource package===== | + | =====LAB #2 - La Ressource package===== |
====L' | ====L' | ||
Ligne 306: | Ligne 346: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
- | **Important** - Si de multiple versions d'un paquet existe, en spécifiant **ensure => to install** Puppet installera la version par défault. Par contre, en spécifiant **ensure => latest**, Puppet installera la version la plus récente. | + | **Important** - Si de multiple versions d'un paquet existe, en spécifiant **ensure => to install** Puppet installera la version par défaut. Par contre, en spécifiant **ensure => latest**, Puppet installera la version la plus récente. |
</ | </ | ||
Ligne 327: | Ligne 367: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Un Ruby Gem est une bibliothèque Ruby qui étend les fonctionalités de ce premier. Dans le fichier précédent, | **Important** - Un Ruby Gem est une bibliothèque Ruby qui étend les fonctionalités de ce premier. Dans le fichier précédent, | ||
</ | </ | ||
Ligne 369: | Ligne 409: | ||
</ | </ | ||
- | Pour vérifer | + | Pour vérifier |
< | < | ||
Ligne 407: | Ligne 447: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
- | **Important** - Par défault, quand Puppet supprime un paquet, il laisse les fichiers associés avec le paquet en place. Pour purger ces fichiers, il concient | + | **Important** - Par défaut, quand Puppet supprime un paquet, il laisse les fichiers associés avec le paquet en place. Pour purger ces fichiers, il convient |
</ | </ | ||
- | =====LAB #12 - La Ressource service===== | + | =====LAB #3 - La Ressource service===== |
Puppet a besoin de vérifier si un service a été démarré : | Puppet a besoin de vérifier si un service a été démarré : | ||
Ligne 431: | Ligne 471: | ||
====L' | ====L' | ||
- | La façon que cette vérification a lieu dépend du système d' | + | La façon que cette vérification a lieu dépend du système d' |
Dans certains cas Puppet essayera de démarrer un service chaque fois qu'il est exécuté. Ceci implique en règle générale que Puppet ne dispose pas de façon à vérifier si le service a déjà démarré. Dans ce cas, il convient d' | Dans certains cas Puppet essayera de démarrer un service chaque fois qu'il est exécuté. Ceci implique en règle générale que Puppet ne dispose pas de façon à vérifier si le service a déjà démarré. Dans ce cas, il convient d' | ||
Ligne 512: | Ligne 552: | ||
</ | </ | ||
- | HERE | + | =====LAB #4 - La Ressource user===== |
- | + | ||
- | =====LAB #13 - La Ressource user===== | + | |
Un utilisateur est un objet qui peut : | Un utilisateur est un objet qui peut : | ||
Ligne 522: | Ligne 560: | ||
* éventuellement peut lire ou modifier les fichiers d' | * éventuellement peut lire ou modifier les fichiers d' | ||
- | ====Créer un Utlisateur==== | + | ====Créer un Utilisateur==== |
Créez le fichier **user.pp** : | Créez le fichier **user.pp** : | ||
Ligne 547: | Ligne 585: | ||
< | < | ||
vagrant@ubuntu-xenial: | vagrant@ubuntu-xenial: | ||
- | Notice: Compiled catalog for ubuntu-xenial in environment production in 0.06 seconds | + | Notice: Compiled catalog for ubuntu-xenial in environment production in 0.01 seconds |
+ | Notice: / | ||
Notice: / | Notice: / | ||
- | Notice: Applied catalog in 0.19 seconds | + | Notice: Applied catalog in 0.04 seconds |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
- | **Important** - Le type de la ressource est le login de l' | + | **Important** - Le type de la ressource est le login de l’utilisateur |
</ | </ | ||
Ligne 560: | Ligne 599: | ||
< | < | ||
vagrant@ubuntu-xenial: | vagrant@ubuntu-xenial: | ||
+ | messagebus: | ||
uuidd: | uuidd: | ||
dnsmasq: | dnsmasq: | ||
Ligne 576: | Ligne 616: | ||
vagrant@ubuntu-xenial: | vagrant@ubuntu-xenial: | ||
total 8 | total 8 | ||
- | drwxr-xr-x 3 ubuntu | + | drwxr-xr-x 3 ubuntu |
- | drwxr-xr-x | + | drwxr-xr-x |
</ | </ | ||
Ligne 596: | Ligne 636: | ||
< | < | ||
vagrant@ubuntu-xenial: | vagrant@ubuntu-xenial: | ||
- | Notice: Compiled catalog for ubuntu-xenial in environment production in 0.07 seconds | + | Notice: Compiled catalog for ubuntu-xenial in environment production in 0.01 seconds |
Notice: / | Notice: / | ||
- | Notice: Applied catalog in 0.19 seconds | + | Notice: Applied catalog in 0.05 seconds |
</ | </ | ||
Ligne 605: | Ligne 645: | ||
< | < | ||
vagrant@ubuntu-xenial: | vagrant@ubuntu-xenial: | ||
+ | lxd: | ||
+ | messagebus: | ||
uuidd: | uuidd: | ||
dnsmasq: | dnsmasq: | ||
Ligne 615: | Ligne 657: | ||
</ | </ | ||
- | =====LAB #14 - La Ressource cron===== | + | =====LAB #5 - La Ressource cron===== |
Consultez le fichier **~/ | Consultez le fichier **~/ | ||
< | < | ||
- | vagrant@ubuntu-xenial: | + | vagrant@ubuntu-xenial: |
# Set up regular Puppet runs | # Set up regular Puppet runs | ||
file { '/ | file { '/ | ||
Ligne 634: | Ligne 676: | ||
</ | </ | ||
- | Rappelez-vous que ce manifest avait crée le fichier crontab de **root** : | + | Rappelez-vous que ce manifest avait créé |
< | < | ||
vagrant@ubuntu-xenial: | vagrant@ubuntu-xenial: | ||
- | # HEADER: This file was autogenerated at 2018-05-27 07:26:05 +0000 by puppet. | + | # HEADER: This file was autogenerated at 2020-02-11 10:08:47 +0000 by puppet. |
# HEADER: While it can still be managed manually, it is definitely not recommended. | # HEADER: While it can still be managed manually, it is definitely not recommended. | ||
# HEADER: Note particularly that the comments starting with ' | # HEADER: Note particularly that the comments starting with ' | ||
Ligne 665: | Ligne 707: | ||
====L' | ====L' | ||
- | Cet attribut permet de définir des variables | + | Cet attribut permet de définir des variables |
====L' | ====L' | ||
Ligne 695: | Ligne 737: | ||
</ | </ | ||
- | =====LAB #15 - La Ressource exec===== | + | =====LAB #6 - La Ressource exec===== |
La ressource **exec** permet d' | La ressource **exec** permet d' | ||
Ligne 723: | Ligne 765: | ||
==== L' | ==== L' | ||
- | Cet attribut indique un fichier qui sera présent après l' | + | Cet attribut indique un fichier qui sera présent après l' |
====L' | ====L' | ||
Ligne 743: | Ligne 785: | ||
< | < | ||
vagrant@ubuntu-xenial: | vagrant@ubuntu-xenial: | ||
- | Notice: Compiled catalog for ubuntu-xenial in environment production in 0.20 seconds | + | Notice: Compiled catalog for ubuntu-xenial in environment production in 0.06 seconds |
Notice: / | Notice: / | ||
- | Notice: Applied catalog in 0.15 seconds | + | Notice: Applied catalog in 0.03 seconds |
vagrant@ubuntu-xenial: | vagrant@ubuntu-xenial: | ||
Ligne 751: | Ligne 793: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Si l' | **Important** - Si l' | ||
</ | </ | ||
Ligne 766: | Ligne 808: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - L' | **Important** - L' | ||
</ | </ | ||
Ligne 772: | Ligne 814: | ||
====L' | ====L' | ||
- | L' | + | L' |
====L' | ====L' | ||
Ligne 825: | Ligne 867: | ||
---- | ---- | ||
- | < | + | |
- | <DIV ALIGN=" | + | Copyright © 2022 Hugh Norris. |
- | Copyright © 2020 Hugh Norris.< | + | |
- | </ | + | |
- | </ | + |