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:centos:8:lcf900:l706 [2023/10/24 12:54] – admin | elearning:workbooks:centos:8:lcf900:l706 [2024/06/10 11:46] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2023.01** | + | Version : **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
Ligne 27: | Ligne 27: | ||
* 4.3 - Restaurer l' | * 4.3 - Restaurer l' | ||
* LAB #5 - Utilisation de l' | * LAB #5 - Utilisation de l' | ||
+ | * 5.1 - Créer un Job Simple | ||
+ | * 5.2 - Créer un Projet | ||
+ | * 5.3 - Créer un Inventory | ||
+ | * 5.4 - Créer des Informations d' | ||
+ | * 5.5 - Créer un Gabarit | ||
+ | * 5.6 - Exécuter un Job | ||
* LAB #6 - Utilisation de l' | * LAB #6 - Utilisation de l' | ||
+ | * 6.1 - Créer une Collection | ||
+ | * 6.1 - Téléverser une Collection | ||
=====LAB#1 - Ansible® Automation Controller===== | =====LAB#1 - Ansible® Automation Controller===== | ||
Ligne 33: | Ligne 41: | ||
====1.1 - Préparation==== | ====1.1 - Préparation==== | ||
- | Avant de commencer, ouvrez un compte développeur chez **[[https:// | + | Avant de commencer, ouvrez un compte développeur chez **[[https:// |
<WRAP center round important 50%> | <WRAP center round important 50%> | ||
Ligne 45: | Ligne 53: | ||
</ | </ | ||
- | Connectez-vous ensuite à votre VM **RedHat_10.0.2.101_SSH** | + | Connectez-vous ensuite à votre VM **RedHat_10.0.2.101_SSH**. |
Enregistrez la VM dans **votre** compte Red Hat : | Enregistrez la VM dans **votre** compte Red Hat : | ||
Ligne 98: | Ligne 106: | ||
</ | </ | ||
- | Modifiez le fichier **/ | + | Modifiez le fichier **/ |
- | + | ||
- | < | + | |
- | [root@redhat9 ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | + | |
- | [root@redhat9 ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | + | |
- | 127.0.0.1 | + | |
- | ::1 | + | |
- | redhat9.ittraining.loc | + | |
- | autohub.ittraining.loc | + | |
- | </ | + | |
< | < | ||
Ligne 288: | Ligne 287: | ||
====1.3 - Consultation==== | ====1.3 - Consultation==== | ||
- | Connectez-vous à votre VM **Debian_10.0.2.46_VNC** | + | Connectez-vous à votre VM **Debian_10.0.2.46_VNC** : |
- | {{ : | + | {{ : |
- | Ouvrez un navigateur Web et naviguez à **https:// | + | Ouvrez un navigateur Web et naviguez à **https:// |
- | {{ : | + | {{ : |
Acceptez le certificat auto-signé : | Acceptez le certificat auto-signé : | ||
- | {{ : | + | {{ : |
Connectez-vous à votre Ansible® Automation Controller en utilisant le compte **admin** et le mot de passe **fenestros** : | Connectez-vous à votre Ansible® Automation Controller en utilisant le compte **admin** et le mot de passe **fenestros** : | ||
- | {{ : | + | {{ : |
Cliquez sur le bouton **Username/ | Cliquez sur le bouton **Username/ | ||
- | {{ : | + | {{ : |
Vous obtiendrez : | Vous obtiendrez : | ||
- | {{ : | + | {{ : |
=====LAB #2 - Ansible® Automation Hub===== | =====LAB #2 - Ansible® Automation Hub===== | ||
Ligne 316: | Ligne 315: | ||
====2.1 - Préparation==== | ====2.1 - Préparation==== | ||
- | Connectez-vous maintenant à votre VM **AutoHub_10.0.2.102_SSH** ou **AutoHub_10.0.3.102_SSH** selon votre numéro de stagiaire. | + | Connectez-vous maintenant à votre VM **autohub.ittraining.loc** : |
+ | |||
+ | < | ||
+ | [root@redhat9 ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | ||
+ | </ | ||
Enregistrez la VM dans **votre** compte Red Hat : | Enregistrez la VM dans **votre** compte Red Hat : | ||
Ligne 354: | Ligne 357: | ||
::1 | ::1 | ||
10.0.2.102 | 10.0.2.102 | ||
- | </ | ||
- | |||
- | ou | ||
- | |||
- | < | ||
- | [root@autohub ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | ||
- | [root@autohub ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | ||
- | 127.0.0.1 | ||
- | ::1 | ||
- | 10.0.3.102 | ||
</ | </ | ||
Ligne 469: | Ligne 462: | ||
< | < | ||
- | [root@backuphub | + | [root@autohub |
... | ... | ||
PLAY RECAP ********************************************************************* | PLAY RECAP ********************************************************************* | ||
Ligne 496: | Ligne 489: | ||
====2.3 - Consultation==== | ====2.3 - Consultation==== | ||
- | Connectez-vous à votre VM **Debian_10.0.2.46_VNC** | + | Connectez-vous à votre VM **Debian_10.0.2.46_VNC** : |
- | {{ : | + | {{ : |
- | Ouvrez un navigateur Web et naviguez à **https:// | + | Ouvrez un navigateur Web et naviguez à **https:// |
- | {{ : | + | {{ : |
Acceptez le certificat auto-signé : | Acceptez le certificat auto-signé : | ||
- | {{ : | + | {{ : |
Connectez-vous à votre Ansible® Automation Hub en utilisant le compte **admin** et le mot de passe **fenestros** : | Connectez-vous à votre Ansible® Automation Hub en utilisant le compte **admin** et le mot de passe **fenestros** : | ||
- | {{ : | + | {{ : |
Vous obtiendrez : | Vous obtiendrez : | ||
- | {{ : | + | {{ : |
=====LAB #3 - Connecter l' | =====LAB #3 - Connecter l' | ||
Ligne 522: | Ligne 515: | ||
Dans l' | Dans l' | ||
- | {{ : | + | {{ : |
Copiez le token ainsi généré : | Copiez le token ainsi généré : | ||
- | {{ : | + | {{ : |
Collez ce token dans un bloc-note (mousepad) : | Collez ce token dans un bloc-note (mousepad) : | ||
- | {{ : | + | {{ : |
====3.2 - Configurer Ansible® Automation Controller==== | ====3.2 - Configurer Ansible® Automation Controller==== | ||
Ligne 536: | Ligne 529: | ||
Ouvrez l' | Ouvrez l' | ||
- | {{ : | + | {{ : |
Naviguez à **Resources > Credentials** et cliquez sur le bouton **Add** : | Naviguez à **Resources > Credentials** et cliquez sur le bouton **Add** : | ||
- | {{ : | + | {{ : |
Renseignez les champs **Name**, **Description** et **Galaxy Server URL**. Choisissez **Galaxy/ | Renseignez les champs **Name**, **Description** et **Galaxy Server URL**. Choisissez **Galaxy/ | ||
- | {{ : | + | {{ : |
Cliquez sur la loupe à gauche du champs **Organization** : | Cliquez sur la loupe à gauche du champs **Organization** : | ||
- | {{ : | + | {{ : |
Cochez l' | Cochez l' | ||
- | {{ : | + | {{ : |
Validez en cliquant sur le bouton **Save** : | Validez en cliquant sur le bouton **Save** : | ||
- | {{ : | + | {{ : |
Vous obtiendrez : | Vous obtiendrez : | ||
- | {{ : | + | {{ : |
Cliquez sur **Settings > Jobs settings** : | Cliquez sur **Settings > Jobs settings** : | ||
- | {{ : | + | {{ : |
Vous obtiendrez : | Vous obtiendrez : | ||
- | {{ : | + | {{ : |
Descendez la page et cliquez sur le bouton **Edit** : | Descendez la page et cliquez sur le bouton **Edit** : | ||
- | {{ : | + | {{ : |
Activez l' | Activez l' | ||
- | {{ : | + | {{ : |
Descendez en bas de la page et cliquez sur le bouton **Save** : | Descendez en bas de la page et cliquez sur le bouton **Save** : | ||
- | {{ : | + | {{ : |
Naviguez à **Organizations** et cliquez sur l' | Naviguez à **Organizations** et cliquez sur l' | ||
- | {{ : | + | {{ : |
Dans le champs **Galaxy Credentials**, | Dans le champs **Galaxy Credentials**, | ||
- | {{ : | + | {{ : |
Cliquez sur la loupe à gauche du champs **Galaxy Credentials** : | Cliquez sur la loupe à gauche du champs **Galaxy Credentials** : | ||
- | {{ : | + | {{ : |
Vous obtiendrez : | Vous obtiendrez : | ||
- | {{ : | + | {{ : |
Cochez **Autohub** PUIS **Ansible Galaxy** puis cliquez sur le bouton **Select** : | Cochez **Autohub** PUIS **Ansible Galaxy** puis cliquez sur le bouton **Select** : | ||
- | {{ : | + | {{ : |
Cliquez ensuite sur le bouton **Save** : | Cliquez ensuite sur le bouton **Save** : | ||
- | {{ : | + | {{ : |
Vous obtiendrez : | Vous obtiendrez : | ||
- | {{ : | + | {{ : |
<WRAP center round tip 50%> | <WRAP center round tip 50%> | ||
Ligne 617: | Ligne 610: | ||
====4.1 - Sauvegarder l' | ====4.1 - Sauvegarder l' | ||
+ | |||
+ | Revenez dans votre Ansible® Automation Controller. | ||
La sauvegarde de l' | La sauvegarde de l' | ||
Ligne 632: | Ligne 627: | ||
</ | </ | ||
- | A l' | + | A l' |
< | < | ||
Ligne 656: | Ligne 651: | ||
====4.2 - Sauvegarder l' | ====4.2 - Sauvegarder l' | ||
+ | |||
+ | Connectez-vous maintenant à votre VM **autohub.ittraining.loc** : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | ||
+ | </ | ||
La sauvegarde de l' | La sauvegarde de l' | ||
Ligne 672: | Ligne 673: | ||
</ | </ | ||
- | A l' | + | A l' |
< | < | ||
Ligne 717: | Ligne 718: | ||
Warning: Permanently added ' | Warning: Permanently added ' | ||
trainee@10.0.2.103' | trainee@10.0.2.103' | ||
- | automation-platform-backup.tar.gz | ||
- | </ | ||
- | |||
- | ou | ||
- | |||
- | < | ||
- | [root@autohub ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | ||
- | The authenticity of host ' | ||
- | ED25519 key fingerprint is SHA256: | ||
- | This key is not known by any other names | ||
- | Are you sure you want to continue connecting (yes/ | ||
- | Warning: Permanently added ' | ||
- | trainee@10.0.3.103' | ||
automation-platform-backup.tar.gz | automation-platform-backup.tar.gz | ||
</ | </ | ||
Ligne 738: | Ligne 726: | ||
[root@autohub ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | [root@autohub ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | ||
trainee@10.0.2.103' | trainee@10.0.2.103' | ||
- | inventory | ||
- | </ | ||
- | |||
- | ou | ||
- | |||
- | < | ||
- | [root@autohub ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | ||
- | trainee@10.0.3.103' | ||
inventory | inventory | ||
</ | </ | ||
Ligne 757: | Ligne 737: | ||
Create an account or view all your systems at https:// | Create an account or view all your systems at https:// | ||
Last login: Tue Oct 24 13:02:01 2023 from 10.0.2.1 | Last login: Tue Oct 24 13:02:01 2023 from 10.0.2.1 | ||
- | [trainee@backuphub ~]$ su - | ||
- | Password: fenestros | ||
- | [root@backuphub ~]# | ||
- | </ | ||
- | |||
- | ou | ||
- | |||
- | < | ||
- | [root@autohub ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | ||
- | trainee@10.0.3.103' | ||
- | Register this system with Red Hat Insights: insights-client --register | ||
- | Create an account or view all your systems at https:// | ||
- | Last login: Tue Oct 24 13:02:01 2023 from 10.0.3.1 | ||
[trainee@backuphub ~]$ su - | [trainee@backuphub ~]$ su - | ||
Password: fenestros | Password: fenestros | ||
Ligne 832: | Ligne 799: | ||
<WRAP center round important 50%> | <WRAP center round important 50%> | ||
- | **Important** : Le processus de restauration recherche le fichier | + | **Important** : Le processus de restauration recherche le fichier |
</ | </ | ||
Ligne 901: | Ligne 868: | ||
=====LAB #5 - Utilisation de l' | =====LAB #5 - Utilisation de l' | ||
- | < | + | ====5.1 - Créer un Job Simple==== |
- | </ | + | Revenez dans votre Ansible® Automation Controller. |
+ | |||
+ | Commencez par créer un playbook simple, destiné à imprimer la phrase **Hello World!** : | ||
< | < | ||
+ | [root@redhat9 ansible-automation-platform-setup-bundle-2.4-2.2-x86_64]# | ||
+ | [root@redhat9 ~]# vi hello-world.yml | ||
+ | |||
+ | [root@redhat9 ~]# cat hello-world.yml | ||
+ | --- | ||
+ | - hosts: all | ||
+ | tasks: | ||
+ | - name: Hello World | ||
+ | debug: | ||
+ | msg: Hello World! | ||
</ | </ | ||
- | < | + | Vérifiez la syntaxe de ce playbook : |
- | + | ||
- | </ | + | |
< | < | ||
+ | [root@redhat9 ~]# ansible-playbook --syntax-check hello-world.yml | ||
+ | [WARNING]: provided hosts list is empty, only localhost is available. Note that the | ||
+ | implicit localhost does not match ' | ||
+ | playbook: hello-world.yml | ||
</ | </ | ||
- | < | + | Notez l' |
- | + | ||
- | </ | + | |
< | < | ||
+ | [root@redhat9 ~]# vi inventory | ||
+ | [root@redhat9 ~]# cat inventory | ||
+ | [Test] | ||
+ | localhost ansible_connection=local | ||
</ | </ | ||
- | < | + | Vérifiez de nouveau la syntaxe de ce playbook : |
- | + | ||
- | </ | + | |
< | < | ||
+ | [root@redhat9 ~]# ansible-playbook --syntax-check hello-world.yml | ||
+ | [WARNING]: provided hosts list is empty, only localhost is available. Note that the | ||
+ | implicit localhost does not match ' | ||
+ | playbook: hello-world.yml | ||
</ | </ | ||
- | < | + | Notez l' |
- | + | ||
- | </code> | + | |
< | < | ||
+ | [root@redhat9 ~]# ls -l / | ||
+ | -rw-r--r--. 1 root root 1018 Jun 5 17:30 / | ||
+ | [root@redhat9 ~]# cat / | ||
+ | # This is the default ansible ' | ||
+ | # | ||
+ | # It should live in / | ||
+ | # | ||
+ | # - Comments begin with the '#' | ||
+ | # - Blank lines are ignored | ||
+ | # - Groups of hosts are delimited by [header] elements | ||
+ | # - You can enter hostnames or ip addresses | ||
+ | # - A hostname/ip can be a member of multiple groups | ||
- | </ | + | # Ex 1: Ungrouped hosts, specify before any group headers: |
- | < | + | ## green.example.com |
+ | ## blue.example.com | ||
+ | ## 192.168.100.1 | ||
+ | ## 192.168.100.10 | ||
- | </ | + | # Ex 2: A collection of hosts belonging to the ' |
- | < | + | ## [webservers] |
+ | ## alpha.example.org | ||
+ | ## beta.example.org | ||
+ | ## 192.168.1.100 | ||
+ | ## 192.168.1.110 | ||
- | </ | + | # If you have multiple hosts following a pattern, you can specify |
+ | # them like this: | ||
- | < | + | ## www[001: |
- | </ | + | # Ex 3: A collection of database servers in the ' |
- | < | + | ## [dbservers] |
+ | ## | ||
+ | ## db01.intranet.mydomain.net | ||
+ | ## db02.intranet.mydomain.net | ||
+ | ## 10.25.1.56 | ||
+ | ## 10.25.1.57 | ||
- | </ | + | # Here's another example of host ranges, this time there are no |
+ | # leading 0s: | ||
- | < | + | ## db-[99: |
</ | </ | ||
- | < | + | Testez le playbook en indiquant le fichier inventory créé au dessus : |
- | + | ||
- | </ | + | |
< | < | ||
+ | [root@redhat9 ~]# ansible-playbook -i inventory hello-world.yml | ||
- | </ | + | PLAY [all] *************************************************************************** |
- | < | + | TASK [Gathering Facts] *************************************************************** |
+ | ok: [localhost] | ||
- | </code> | + | TASK [Hello World] ******************************************************************* |
- | + | ok: [localhost] => { | |
- | < | + | " |
+ | } | ||
+ | PLAY RECAP *************************************************************************** | ||
+ | localhost | ||
</ | </ | ||
- | < | + | ====5.2 - Créer un Projet==== |
- | </code> | + | Pour exécuter ce même playbook avec Red Hat® Ansible® Automation Platform, il faut créer un projet. Les projets sont des répertoire dans **/var/ |
< | < | ||
+ | [root@redhat9 ~]# mkdir / | ||
+ | [root@redhat9 ~]# cp hello-world.yml / | ||
</ | </ | ||
- | < | + | Connectez-vous à votre **VM Debian_10.0.2.46_VNC**. Ouvrez un navigateur Web et naviguez à **https:// |
- | </ | + | {{ : |
- | < | + | Cliquez sur **Projects** puis sur le bouton **Add** : |
- | </ | + | {{ : |
- | < | + | Indiquez **Test Project** dans **Name**, **My test Project** dans **Description**, |
- | </ | + | {{ : |
- | =====LAB #6 - Utilisation | + | Vérifiez les informations |
- | < | + | {{ : |
- | </ | + | ====5.3 - Créer un Inventory==== |
- | < | + | Cliquez ensuite sur **Inventories** : |
- | </ | + | {{ : |
- | < | + | Cliquez sur le lien **Demo Inventory** : |
- | </ | + | {{ : |
- | < | + | Cliquez sur le lien **Hosts** et cochez **localhost** : |
- | </ | + | {{ : |
- | < | + | ====5.4 - Créer des Informations d' |
- | </ | + | Cliquez sur **Credentials** : |
- | < | + | {{ : |
- | </ | + | Éditez **Demo Credential** en indiquant **trainee** en tant que **Username** et **trainee** en tant que **Password** : |
- | < | + | {{ : |
- | </ | + | Cliquez sur le bouton **Save** : |
- | < | + | {{ : |
- | </ | + | Vous obtiendrez : |
- | < | + | {{ : |
- | </ | + | ====5.5 - Créer un Gabarit==== |
- | < | + | Cliquez sur **Templates** puis cliquez sur **Demo Job Template** : |
- | </ | + | {{ : |
- | < | + | Cliquez sur la loupe dans le champs **Project** : |
- | </ | + | {{ : |
- | < | + | Vous obtiendrez : |
- | </ | + | {{ : |
- | < | + | Cochez **Test Project** puis cliquez sur le bouton **Select** : |
- | </ | + | {{ : |
- | < | + | Vous verrez le Playbook **hello-world.yml** apparaître dans le champs **Playbook** : |
- | </ | + | {{ : |
- | < | + | Cliquez sur le bouton **Save** : |
- | </ | + | {{ : |
- | < | + | Vérifiez votre Template puis cliquez sur le lien **Templates** : |
- | </ | + | {{ : |
- | < | + | ====5.6 - Exécuter un Job==== |
- | </ | + | Cliquez sur l' |
- | < | + | {{ : |
- | </ | + | Cliquez sur **Jobs** : |
- | < | + | {{ : |
- | </ | + | Cliquez sur **Demo Job Template** et constatez la réussite de l' |
- | < | + | {{ : |
- | </ | + | =====LAB #6 - Utilisation de l' |
- | < | + | ====6.1 - Créer une Collection==== |
- | </ | + | Connectez-vous ensuite à votre VM **autohub.ittraining.loc** : |
< | < | ||
+ | [root@redhat9 ~]# ssh -l trainee 10.0.2.102 | ||
</ | </ | ||
- | < | + | Créez un répertoire appelé **collection** et placez-vous dedans : |
- | + | ||
- | </ | + | |
< | < | ||
+ | [trainee@autohub ~]$ mkdir collection | ||
+ | [trainee@autohub ~]$ cd collection | ||
</ | </ | ||
- | < | + | Créez une **Collection** vide appelée **ittraining** dans un **Namespace** appelé **ittraining** avec la commande **ansible-galaxy** : |
- | + | ||
- | </ | + | |
< | < | ||
+ | [trainee@autohub collection]$ ansible-galaxy collection init ittraining.ittraining | ||
+ | - Collection ittraining.ittraining was created successfully | ||
</ | </ | ||
- | < | + | Consultez l' |
- | + | ||
- | </ | + | |
< | < | ||
+ | [trainee@autohub collection]$ tree | ||
+ | . | ||
+ | └── ittraining | ||
+ | └── ittraining | ||
+ | ├── docs | ||
+ | ├── galaxy.yml | ||
+ | ├── meta | ||
+ | │ | ||
+ | ├── plugins | ||
+ | │ | ||
+ | ├── README.md | ||
+ | └── roles | ||
+ | 6 directories, | ||
</ | </ | ||
- | < | + | Les informations concernant la Collection sont stockées dans le fichier **~/collections/ |
- | + | ||
- | </code> | + | |
< | < | ||
+ | [trainee@autohub collection]$ cat ittraining/ | ||
+ | ### REQUIRED | ||
+ | # The namespace of the collection. This can be a company/ | ||
+ | # content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with | ||
+ | # underscores or numbers and cannot contain consecutive underscores | ||
+ | namespace: ittraining | ||
- | </ | + | # The name of the collection. Has the same character restrictions as ' |
+ | name: ittraining | ||
- | < | + | # The version of the collection. Must be compatible with semantic versioning |
+ | version: 1.0.0 | ||
- | </ | + | # The path to the Markdown (.md) readme file. This path is relative to the root of the collection |
+ | readme: README.md | ||
- | <code> | + | # A list of the collection' |
+ | # @nicks: | ||
+ | authors: | ||
+ | - your name < | ||
- | </ | ||
- | < | + | ### OPTIONAL but strongly recommended |
+ | # A short summary description of the collection | ||
+ | description: | ||
- | </code> | + | # Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only |
+ | # accepts L(SPDX, | ||
+ | license: | ||
+ | - GPL-2.0-or-later | ||
- | < | + | # The path to the license file for the collection. This path is relative to the root of the collection. This key is |
+ | # mutually exclusive with ' | ||
+ | license_file: | ||
- | </code> | + | # A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character |
+ | # requirements as ' | ||
+ | tags: [] | ||
- | < | + | # Collections that this collection requires to be installed for it to be usable. The key of the dict is the |
+ | # collection label ' | ||
+ | # L(specifiers, | ||
+ | # range specifiers can be set and are separated by ',' | ||
+ | dependencies: | ||
- | </code> | + | # The URL of the originating SCM repository |
+ | repository: http:// | ||
- | < | + | # The URL to any online docs |
+ | documentation: | ||
- | </code> | + | # The URL to the homepage of the collection/project |
+ | homepage: http:// | ||
- | < | + | # The URL to the collection issue tracker |
+ | issues: http:// | ||
- | </ | + | # A list of file glob-like patterns used to filter any files or directories that should not be included in the build |
- | + | # artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This | |
- | < | + | # uses ' |
+ | # and ' | ||
+ | build_ignore: | ||
+ | # A dict controlling use of manifest directives used in building the collection artifact. The key ' | ||
+ | # list of MANIFEST.in style | ||
+ | # L(directives, | ||
+ | # ' | ||
+ | # with ' | ||
+ | # manifest: null | ||
</ | </ | ||
- | < | + | Éditez la ligne **requires-ansible** dans le fichier **~/collections/ |
- | + | ||
- | </code> | + | |
< | < | ||
+ | [trainee@autohub collection]$ vi ittraining/ | ||
- | </code> | + | [trainee@autohub collection]$ cat ittraining/ittraining/ |
+ | --- | ||
+ | # Collections must specify a minimum required ansible version to upload | ||
+ | # to galaxy | ||
+ | requires_ansible: | ||
- | < | + | # Content that Ansible needs to load from another location or that has |
+ | # been deprecated/ | ||
+ | # plugin_routing: | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # See the porting guide on how to update your playbook to | ||
+ | # use ns.col.another_plugin instead. | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # See the porting guide on how to update your playbook to | ||
+ | # use ns.col.another_plugin instead. | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # vars: | ||
- | </ | + | # Python import statements that Ansible needs to load from another location |
- | + | # import_redirection: | |
- | < | + | # |
+ | # | ||
+ | # Groups of actions/ | ||
+ | # action_groups: | ||
+ | # | ||
+ | # - module1 | ||
+ | # - module2 | ||
</ | </ | ||
- | < | + | Placez-vous dans le répertoire **~/collections/ |
- | + | ||
- | </code> | + | |
< | < | ||
+ | [trainee@autohub collection]$ cd ittraining/ | ||
+ | [trainee@autohub ittraining]$ ls | ||
+ | docs galaxy.yml | ||
</ | </ | ||
- | < | + | Construisez la Collection **ittraining-ittraining-1.0.0.tar.gz** avec la commande **ansible-galaxy collection build** : |
- | + | ||
- | </ | + | |
< | < | ||
+ | [trainee@autohub ittraining]$ ansible-galaxy collection build | ||
+ | Created collection for ittraining.ittraining at / | ||
</ | </ | ||
- | < | + | ====6.2 - Téléverser une Collection==== |
- | </code> | + | Connectez-vous à votre **VM Debian_10.0.2.46_VNC**. Ouvrez un navigateur Web et naviguez à **https:// |
- | < | + | {{ : |
- | </ | + | Cliquez ensuite sur **Namespaces** dans le menu de gauche puis cliquez sur le bouton **Create** : |
- | < | + | {{ : |
- | </ | + | Renseignez le nom **ittraining** et cliquez sur le bouton **Create** : |
- | < | + | {{ : |
- | </ | + | Notez que pour l' |
- | < | + | {{ : |
- | </ | + | Dans la fenêtre **New collection**, |
- | < | + | {{ : |
- | </code> | + | <WRAP center round important 50%> |
+ | **Important** : Notez que le dépôt de destination est **staging**. Le dépôt staging est utilisé pour téléverser toute nouvelle Collection avant que celle-ci soit vérifiée pour publication. | ||
+ | </WRAP> | ||
- | < | + | Choisissez le fichier **ittraining-ittraining-1.0.0.tar.gz** : |
- | </ | + | {{ : |
- | < | + | Cliquez ensuite sur le bouton **Upload** : |
- | </ | + | {{ : |
- | < | + | A l'issu de quelques secondes, la **Collection** est téléversée : |
- | </ | + | {{ : |
- | <code> | + | <WRAP center round important 50%> |
+ | **Important** : Notez la ligne **Approval status: waiting for approval**. | ||
+ | </WRAP> | ||
- | </ | + | Développez l'item **Collections** dans le menu de gauche : |
- | < | + | {{ : |
- | </ | + | Cliquez sur **Repositories** : |
- | < | + | {{ : |
- | </ | + | Descendez en bas de la liste des **Repositories** et cliquez sur **staging** : |
- | < | + | {{ : |
- | </ | + | Vous obtiendrez : |
- | < | + | {{ : |
- | </ | + | Cliquez sur l' |
- | < | + | {{ : |
- | </ | + | Cliquez ensuite sur l'item **Approval** dans le menu de gauche : |
- | < | + | {{ : |
- | </code> | + | <WRAP center round important 50%> |
+ | **Important** : Notez que l'item **Approvals** est présent parce que vous êtes connecté en tant qu' | ||
+ | </WRAP> | ||
- | < | + | Dans le cas où vous souhaiteriez rejeter cette Collection, il conviendrait de cliquez sur les trois points verticaux à droite de la ligne **ittraining** et de choisir **Reject**. Cliquez ensuite sur le bouton **Approve** : |
- | </ | + | {{ : |
- | < | + | Vous obtiendrez : |
- | </ | + | {{ : |
- | < | + | Cliquez sur **Namespaces** dans le menu de gauche : |
- | </ | + | {{ : |
- | < | + | Dans le champs **Filter by keywords**, saisissez le mot **ittraining** puis cliquez sur l' |
- | </ | + | {{ : |
- | < | + | Cliquez sur le lien **View collections** pour consulter la liste des **Collections** dans le **Namespace** : |
- | </ | + | {{ : |
- | < | + | Constatez la présence de la Collection **ittraining** : |
- | </ | + | {{ : |
----- | ----- | ||
- | Copyright © 2023 Hugh Norris | + | Copyright © 2024 Hugh Norris |