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:debian:6:avance:l129:part3 [2019/11/14 06:16] adminelearning:workbooks:debian:6:avance:l129:part3 [2022/06/12 14:07] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
 +
 +Version : **2022.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
Ligne 5: Ligne 7:
 ======DOF403 - Variables, Expressions, Facts et Itérations====== ======DOF403 - Variables, Expressions, Facts et Itérations======
  
-=====LAB #16 - Variables=====+=====Contenu du Module===== 
 + 
 +  * **DOF403 - Variables, Expressions, Facts et Itérations** 
 +    * Contenu du Module 
 +    * LAB #1 - Variables 
 +      * Variables Simples 
 +      * Tableaux 
 +      * Hashes 
 +    * LAB #2 - Expressions 
 +      * Expressions Mathématiques 
 +      * Expression Booléennes 
 +      * Expressions Régulières 
 +      * Expressions Conditionnelles 
 +    * LAB #3 - Facts 
 +      * Facts dans un Hash 
 +      * Facts dans une Expression 
 +      * Facts Externes 
 +      * Facts Exécutables 
 +    * LAB #4 - Itérations 
 +      * Itération et Tableaux 
 +      * Itération et Hashes 
 + 
 +=====LAB #1 - Variables=====
  
 ====Variables Simples==== ====Variables Simples====
Ligne 19: Ligne 43:
 </file> </file>
  
-<WRAP center round important 50%+<WRAP center round important> 
-**Important** - Le nom d'une variable doit commencer par le caractère **$** puis par une lettre miniscule ou un underscore.+**Important** - Le nom d'une variable doit commencer par le caractère **$** puis par une lettre minuscule ou un underscore.
 </WRAP> </WRAP>
  
Ligne 35: Ligne 59:
 </file> </file>
  
-<WRAP center round important 50%>+<WRAP center round important>
 **Important** - La valeur d'un variable booléenne doit être **true** ou **false**. **Important** - La valeur d'un variable booléenne doit être **true** ou **false**.
 </WRAP> </WRAP>
Ligne 46: Ligne 70:
 $my_name = 'John' $my_name = 'John'
 notice("Hello, ${my_name}! It's great to meet you!") notice("Hello, ${my_name}! It's great to meet you!")
 +
 vagrant@ubuntu-xenial:~$ sudo puppet apply string_interpolation.pp  vagrant@ubuntu-xenial:~$ sudo puppet apply string_interpolation.pp 
 Notice: Scope(Class[main]): Hello, John! It's great to meet you! Notice: Scope(Class[main]): Hello, John! It's great to meet you!
-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: Applied catalog in 0.07 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
-<WRAP center round important 50%>+<WRAP center round important>
 **Important** - Notez l'utilisation de l'attribut **notice** qui imprime la chaîne et le contenu de la variable à l'écran. **Important** - Notez l'utilisation de l'attribut **notice** qui imprime la chaîne et le contenu de la variable à l'écran.
 </WRAP> </WRAP>
Ligne 93: Ligne 118:
 <code> <code>
 vagrant@ubuntu-xenial:~$ sudo apt-get update vagrant@ubuntu-xenial:~$ sudo apt-get update
-Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB] +Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease 
-Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease                                 +Get:http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                                                    
-Get:http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                                    +Get:http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]                                                    
-Ign:4 http://apt.puppetlabs.com xenial InRelease                                                                   +Get:http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]                               
-Hit:5 http://apt.puppetlabs.com xenial Release                                      +Hit:http://apt.puppetlabs.com xenial InRelease                                                                    
-Get:http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] +Fetched 325 kB in 0s (472 kB/s)
-Get:http://archive.ubuntu.com/ubuntu xenial-updates/main Sources [306 kB] +
-Get:http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [783 kB] +
-Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [631 kB] +
-Fetched 2,042 kB in 3s (533 kB/s)                         +
 Reading package lists... Done Reading package lists... Done
  
 vagrant@ubuntu-xenial:~$ sudo puppet apply resource_array.pp vagrant@ubuntu-xenial:~$ sudo puppet apply resource_array.pp
-Notice: Compiled catalog for ubuntu-xenial in environment production in 1.52 seconds+Notice: Compiled catalog for ubuntu-xenial in environment production in 0.48 seconds
 Notice: /Stage[main]/Main/Package[php7.0-cgi]/ensure: created Notice: /Stage[main]/Main/Package[php7.0-cgi]/ensure: created
 Notice: /Stage[main]/Main/Package[php7.0-gd]/ensure: created Notice: /Stage[main]/Main/Package[php7.0-gd]/ensure: created
Ligne 112: Ligne 133:
 Notice: /Stage[main]/Main/Package[php7.0-mysql]/ensure: created Notice: /Stage[main]/Main/Package[php7.0-mysql]/ensure: created
 Notice: /Stage[main]/Main/Package[php7.0-soap]/ensure: created Notice: /Stage[main]/Main/Package[php7.0-soap]/ensure: created
-Notice: Applied catalog in 91.09 seconds+Notice: Applied catalog in 16.33 seconds
 </code> </code>
  
Ligne 130: Ligne 151:
  
 <code> <code>
 +vagrant@ubuntu-xenial:~$ sudo vi variable_hash.pp
 vagrant@ubuntu-xenial:~$ cat variable_hash.pp vagrant@ubuntu-xenial:~$ cat variable_hash.pp
 $heights = { $heights = {
Ligne 147: Ligne 169:
 vagrant@ubuntu-xenial:~$ sudo puppet apply variable_hash.pp vagrant@ubuntu-xenial:~$ sudo puppet apply variable_hash.pp
 Notice: Scope(Class[main]): John's height is 193cm. Notice: Scope(Class[main]): John's height is 193cm.
-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: Applied catalog in 0.07 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 168: Ligne 190:
 </code> </code>
  
-<WRAP center round important 50%>+<WRAP center round important>
 **Important** - Le caractère ***** informe Puppet d'utiliser ce Hash comme une liste d'attributs. **Important** - Le caractère ***** informe Puppet d'utiliser ce Hash comme une liste d'attributs.
 </WRAP> </WRAP>
Ligne 176: Ligne 198:
 <code> <code>
 vagrant@ubuntu-xenial:~$ sudo puppet apply hash_attributes.pp vagrant@ubuntu-xenial:~$ sudo puppet apply hash_attributes.pp
-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: /Stage[main]/Main/File[/tmp/test]/ensure: created Notice: /Stage[main]/Main/File[/tmp/test]/ensure: created
-Notice: Applied catalog in 0.08 seconds+Notice: Applied catalog in 0.01 seconds
  
 vagrant@ubuntu-xenial:~$ ls -l /tmp/test vagrant@ubuntu-xenial:~$ ls -l /tmp/test
--rw-r--r-- 1 ubuntu ubuntu 0 May 28 15:59 /tmp/test+-rw-r--r-- 1 ubuntu ubuntu 0 Feb 11 13:42 /tmp/test
 </code> </code>
  
-=====LAB #17 - Expressions=====+=====LAB #- Expressions=====
  
 ====Expressions Mathématiques==== ====Expressions Mathématiques====
  
-Puppet peut gérer des expressions mathématiques. Creéz donc le fichier **expression_numeric.pp** :+Puppet peut gérer des expressions mathématiques. Créez donc le fichier **expression_numeric.pp** :
  
 <code> <code>
Ligne 202: Ligne 224:
 vagrant@ubuntu-xenial:~$ sudo puppet apply expression_numeric.pp  vagrant@ubuntu-xenial:~$ sudo puppet apply expression_numeric.pp 
 Notice: Scope(Class[main]): 138 Notice: Scope(Class[main]): 138
-Notice: Compiled catalog for ubuntu-xenial in environment production in 0.08 seconds +Notice: Compiled catalog for ubuntu-xenial in environment production in 0.01 seconds 
-Notice: Applied catalog in 0.07 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
 ====Expression Booléennes==== ====Expression Booléennes====
  
-Puppet sait aussi gérer des expression booléennes, c'est-à-dire des expressions qui produisent come résultat soit **vrai** soit **faux**. Créez donc le fichier **expression_boolean.pp** :+Puppet sait aussi gérer des expression booléennes, c'est-à-dire des expressions qui produisent comme résultat soit **vrai** soit **faux**. Créez donc le fichier **expression_boolean.pp** :
  
 <code> <code>
Ligne 228: Ligne 250:
 Les opérateurs utilisés dans le fichier **expression_boolean.pp** sont les suivants : Les opérateurs utilisés dans le fichier **expression_boolean.pp** sont les suivants :
  
-Operateur ^ Description ^ +Opérateur ^ Description ^ 
-| == | Egal |+| == | Égal |
 | != | Pas égal | | != | Pas égal |
-| >, >=, < et %%<=%% | Sauvegarde le document entier et non uniquement le script |+| >, >=, < et %%<=%% | Supérieur, supérieur ou égal, inférieur, inférieur ou égal |
 | A in B | A est une sous-chaîne de B, A est un élément du tableau B ou A est une clef du Hash B | | A in B | A est une sous-chaîne de B, A est un élément du tableau B ou A est une clef du Hash B |
 | A =~ B | A correspond à l'expression régulière B ou A est une valeur qui correspond au type de données de B ( p.e. **'trainee' =~ String** est vrai ) | | A =~ B | A correspond à l'expression régulière B ou A est une valeur qui correspond au type de données de B ( p.e. **'trainee' =~ String** est vrai ) |
Ligne 252: Ligne 274:
 Notice: Scope(Class[main]): true Notice: Scope(Class[main]): true
 Notice: Scope(Class[main]): true Notice: Scope(Class[main]): true
-Notice: Compiled catalog for ubuntu-xenial in environment production in 0.09 seconds +Notice: Compiled catalog for ubuntu-xenial in environment production in 0.01 seconds 
-Notice: Applied catalog in 0.08 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 275: Ligne 297:
  
 <code> <code>
-vagrant@ubuntu-xenial:~$ sudo puppet apply regex.pp +vagrant@ubuntu-xenial:~$ sudo puppet apply regex.pp
 Notice: Scope(Class[main]): true Notice: Scope(Class[main]): true
 Notice: Scope(Class[main]): true Notice: Scope(Class[main]): true
Ligne 282: Ligne 304:
 Notice: Scope(Class[main]): true Notice: Scope(Class[main]): true
 Notice: Scope(Class[main]): true Notice: Scope(Class[main]): true
-Notice: Compiled catalog for ubuntu-xenial in environment production in 0.08 seconds +Notice: Compiled catalog for ubuntu-xenial in environment production in 0.01 seconds 
-Notice: Applied catalog in 0.08 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
-<WRAP center round important 50%>+<WRAP center round important>
 **Important** - La syntaxe des expressions régulières Puppet est la même que celle de **Ruby**. Vous pouvez trouver plus d'informations concernant cette syntaxe à l'adresse suivante : **[[http://ruby-doc.org/core/Regexp.html]]**. **Important** - La syntaxe des expressions régulières Puppet est la même que celle de **Ruby**. Vous pouvez trouver plus d'informations concernant cette syntaxe à l'adresse suivante : **[[http://ruby-doc.org/core/Regexp.html]]**.
 </WRAP> </WRAP>
Ligne 313: Ligne 335:
 <code> <code>
 vagrant@ubuntu-xenial:~$ sudo puppet apply if.pp vagrant@ubuntu-xenial:~$ sudo puppet apply if.pp
-Notice: Compiled catalog for ubuntu-xenial in environment production in 1.55 seconds +Notice: Compiled catalog for ubuntu-xenial in environment production in 0.55 seconds 
-Notice: Applied catalog in 0.17 seconds+Notice: Applied catalog in 0.04 seconds
 </code> </code>
  
Ligne 354: Ligne 376:
 <code> <code>
 vagrant@ubuntu-xenial:~$ sudo puppet apply if.pp vagrant@ubuntu-xenial:~$ sudo puppet apply if.pp
-Notice: Compiled catalog for ubuntu-xenial in environment production in 1.56 seconds+Notice: Compiled catalog for ubuntu-xenial in environment production in 0.46 seconds
 Notice: /Stage[main]/Main/Package[perl]/ensure: removed Notice: /Stage[main]/Main/Package[perl]/ensure: removed
-Notice: Applied catalog in 11.00 seconds+Notice: Applied catalog in 2.03 seconds
 </code> </code>
  
Ligne 374: Ligne 396:
 </code> </code>
  
-Une expression conditionnelle utilsant un **if** ne permet que deux choix. S'il faut plus de choix, il convient d'utiliser **case**. Créez donc le fichier **case.pp** :+HERE 
 + 
 +Une expression conditionnelle utilisant un **if** ne permet que deux choix. S'il faut plus de choix, il convient d'utiliser **case**. Créez donc le fichier **case.pp** :
  
 <code> <code>
Ligne 399: Ligne 423:
  
 <code> <code>
-vagrant@ubuntu-xenial:~$ sudo puppet apply case.pp +vagrant@ubuntu-xenial:~$ sudo puppet apply case.pp
 Notice: Scope(Class[main]): Looks like you're using Nginx! Good choice! Notice: Scope(Class[main]): Looks like you're using Nginx! Good choice!
-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: Applied catalog in 0.07 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
-=====LAB #18 - Facts=====+=====LAB #- Facts=====
  
 Les manifests de Puppet ont souvent besoin de connaître quelque chose concernant le système, par exemple : Les manifests de Puppet ont souvent besoin de connaître quelque chose concernant le système, par exemple :
Ligne 425: Ligne 449:
 </code> </code>
  
-<WRAP center round important 50%>+<WRAP center round important>
 **Important** - Dans ce manifest est utilisé la variable **$facts**. Le fact recherché est fourni en tant que clef - dans notre exemple **kernel**. **Important** - Dans ce manifest est utilisé la variable **$facts**. Le fact recherché est fourni en tant que clef - dans notre exemple **kernel**.
 </WRAP> </WRAP>
Ligne 434: Ligne 458:
 vagrant@ubuntu-xenial:~$ sudo puppet apply facts_hash.pp vagrant@ubuntu-xenial:~$ sudo puppet apply facts_hash.pp
 Notice: Scope(Class[main]): Linux Notice: Scope(Class[main]): Linux
-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: Applied catalog in 0.08 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 442: Ligne 466:
 <code> <code>
 vagrant@ubuntu-xenial:~$ facter os vagrant@ubuntu-xenial:~$ facter os
-... +
- "operatingsystem": "Ubuntu", +  architecture => "amd64", 
-    "operatingsystemmajrelease": "16.04", +  distro => 
-    "operatingsystemrelease": "16.04", +    codename => "xenial", 
-    "os": +    description => "Ubuntu 16.04.LTS", 
-      "architecture": "amd64", +    id => "Ubuntu", 
-      "distro": +    release => 
-        "codename": "xenial", +      full => "16.04", 
-        "description": "Ubuntu 16.04.LTS", +      major => "16.04" 
-        "id": "Ubuntu", +    
-        "release": +  }, 
-          "full": "16.04", +  family => "Debian", 
-          "major": "16.04" +  hardware => "x86_64", 
-        +  name => "Ubuntu", 
-      }, +  release => 
-      "family": "Debian", +    full => "16.04", 
-      "hardware": "x86_64", +    major => "16.04" 
-      "name": "Ubuntu", +  }, 
-      "release": +  selinux => 
-        "full": "16.04", +    enabled => false 
-        "major": "16.04" +  
-      }, +}
-      "selinux": +
-        "enabled": false +
-      +
-    }+
-...+
 </code> </code>
  
-<WRAP center round important 50%>+<WRAP center round important>
 **Important** - Comme vous pouvez constater, la sortie est sous forme de Hashs multiples. **Important** - Comme vous pouvez constater, la sortie est sous forme de Hashs multiples.
 </WRAP> </WRAP>
Ligne 486: Ligne 505:
  
 <code> <code>
-vagrant@ubuntu-xenial:~$ sudo puppet apply facts_architecture.pp +vagrant@ubuntu-xenial:~$ sudo puppet apply facts_architecture.pp
 Notice: Scope(Class[main]): amd64 Notice: Scope(Class[main]): amd64
-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: Applied catalog in 0.08 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 503: Ligne 522:
  
 <code> <code>
-vagrant@ubuntu-xenial:~$ sudo puppet apply facts_distro_codename.pp +vagrant@ubuntu-xenial:~$ sudo puppet apply facts_distro_codename.pp
 Notice: Scope(Class[main]): xenial Notice: Scope(Class[main]): 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: Applied catalog in 0.07 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 522: Ligne 541:
 vagrant@ubuntu-xenial:~$ sudo puppet apply facts_major.pp vagrant@ubuntu-xenial:~$ sudo puppet apply facts_major.pp
 Notice: Scope(Class[main]): 16.04 Notice: Scope(Class[main]): 16.04
-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: Applied catalog in 0.07 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
 Pour obtenir le nom d'hôte, le FQDN et l'adresse IP de la machine, créez le fichier **fact_networking.pp** : Pour obtenir le nom d'hôte, le FQDN et l'adresse IP de la machine, créez le fichier **fact_networking.pp** :
 +
 <code> <code>
 +vagrant@ubuntu-xenial:~$ sudo vi fact_networking.pp
 vagrant@ubuntu-xenial:~$ cat fact_networking.pp vagrant@ubuntu-xenial:~$ cat fact_networking.pp
 notice("My hostname is ${facts['hostname']}") notice("My hostname is ${facts['hostname']}")
Ligne 537: Ligne 558:
  
 <code> <code>
-vagrant@ubuntu-xenial:~$ sudo puppet apply fact_networking.pp +vagrant@ubuntu-xenial:~$ sudo puppet apply fact_networking.pp
 Notice: Scope(Class[main]): My hostname is ubuntu-xenial Notice: Scope(Class[main]): My hostname is ubuntu-xenial
 Notice: Scope(Class[main]): My FQDN is ubuntu-xenial Notice: Scope(Class[main]): My FQDN is ubuntu-xenial
 Notice: Scope(Class[main]): My IP is 10.0.2.15 Notice: Scope(Class[main]): My IP is 10.0.2.15
-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: Applied catalog in 0.08 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 562: Ligne 583:
  
 <code> <code>
-vagrant@ubuntu-xenial:~$ sudo puppet apply fact_ip.pp +vagrant@ubuntu-xenial:~$ sudo puppet apply fact_ip.pp
 Notice: Scope(Class[main]): SELinux is disabled Notice: Scope(Class[main]): SELinux is disabled
-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: Applied catalog in 0.07 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 580: Ligne 601:
  
 <code> <code>
-vagrant@ubuntu-xenial:~$ sudo puppet apply fact_memory.pp  +vagrant@ubuntu-xenial:~$ sudo puppet apply fact_memory.pp 
-Notice: Scope(Class[main]): innodb_buffer_pool_size=780174336 +Notice: Scope(Class[main]): innodb_buffer_pool_size=780091392 
-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: Applied catalog in 0.08 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 627: Ligne 648:
 vagrant@ubuntu-xenial:~$ sudo puppet apply fact_cloud.pp  vagrant@ubuntu-xenial:~$ sudo puppet apply fact_cloud.pp 
 Notice: Scope(Class[main]): This is an AWS cloud server  Notice: Scope(Class[main]): This is an AWS cloud server 
-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: Applied catalog in 0.08 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 636: Ligne 657:
  
 <code> <code>
 +vagrant@ubuntu-xenial:~$ sudo vi date.sh
 vagrant@ubuntu-xenial:~$ cat date.sh vagrant@ubuntu-xenial:~$ cat date.sh
 #!/bin/bash #!/bin/bash
Ligne 647: Ligne 669:
 vagrant@ubuntu-xenial:~$ sudo chmod a+x /opt/puppetlabs/facter/facts.d/date.sh vagrant@ubuntu-xenial:~$ sudo chmod a+x /opt/puppetlabs/facter/facts.d/date.sh
 vagrant@ubuntu-xenial:~$ sudo facter date vagrant@ubuntu-xenial:~$ sudo facter date
-2018-06-01+2020-02-11
 </code> </code>
  
-=====LAB #19 Iteration=====+=====LAB #Itérations=====
  
-Iteration permet d'économiser du code. +Itération permet d'économiser du code. 
  
-====Iteration et Tableaux====+====Itération et Tableaux====
  
-Créez le fichier **iteration_simple;pp**+Créez le fichier **iteration_simple.pp**
  
 <code> <code>
Ligne 677: Ligne 699:
 </code> </code>
  
-<WRAP center round important 50%+<WRAP center round important> 
-**Important** - Dans ce manifest il y a trois ressources presques identiques, différenciées uniquement par le numéro de tâche ( **task1**, **task2**, **task3** ).+**Important** - Dans ce manifest il y a trois ressources presque identiques, différenciées uniquement par le numéro de tâche ( **task1**, **task2**, **task3** ).
 </WRAP> </WRAP>
  
Ligne 684: Ligne 706:
  
 <code> <code>
 +vagrant@ubuntu-xenial:~$ sudo vi iteration_each.pp
 +vagrant@ubuntu-xenial:~$ cat iteration_each.pp
 $tasks = ['task1', 'task2', 'task3'] $tasks = ['task1', 'task2', 'task3']
 $tasks.each | $task | { $tasks.each | $task | {
Ligne 693: Ligne 717:
 </code> </code>
  
-<WRAP center round important 50%>+<WRAP center round important>
 **Important** - Dans ce manifest la fonction **each** crée une boucle qui prend pour chaque exécution une des valeurs du tableau **$tasks** ( **task1**, **task2**, **task3** ). **Important** - Dans ce manifest la fonction **each** crée une boucle qui prend pour chaque exécution une des valeurs du tableau **$tasks** ( **task1**, **task2**, **task3** ).
 </WRAP> </WRAP>
Ligne 705: Ligne 729:
 </file> </file>
  
-<WRAP center round important 50%>+<WRAP center round important>
 **Important** - Ici ARRAY est un tableau et ELEMENT est le nom d'une variable qui contiendra chaque valeur du tableau à tour de rôle. BLOCK est du code Puppet qui appelle l'ELEMENT. **Important** - Ici ARRAY est un tableau et ELEMENT est le nom d'une variable qui contiendra chaque valeur du tableau à tour de rôle. BLOCK est du code Puppet qui appelle l'ELEMENT.
 </WRAP> </WRAP>
Ligne 725: Ligne 749:
  
 <code> <code>
-vagrant@ubuntu-xenial:~$ sudo puppet apply iteration_hash.pp +vagrant@ubuntu-xenial:~$ sudo puppet apply iteration_hash.pp
 Notice: Scope(Class[main]): Interface enp0s3 has IP 10.0.2.15 Notice: Scope(Class[main]): Interface enp0s3 has IP 10.0.2.15
 Notice: Scope(Class[main]): Interface lo has IP 127.0.0.1 Notice: Scope(Class[main]): Interface lo has IP 127.0.0.1
-Notice: Compiled catalog for ubuntu-xenial in environment production in 0.10 seconds +Notice: Compiled catalog for ubuntu-xenial in environment production in 0.02 seconds 
-Notice: Applied catalog in 0.08 seconds+Notice: Applied catalog in 0.01 seconds
 </code> </code>
  
Ligne 735: Ligne 759:
  
 ---- ----
-<html> + 
-<DIV ALIGN="CENTER"> +Copyright © 2022 Hugh Norris.
-Copyright © 2019 Hugh Norris.<br><br> +
-</div> +
-</html>+
Menu