Skip to content

Commit

Permalink
Merge pull request #2174 from ansible/devel
Browse files Browse the repository at this point in the history
update exericses
  • Loading branch information
IPvSean authored Sep 4, 2024
2 parents d9d10b7 + d1a0deb commit 1e9d3e5
Show file tree
Hide file tree
Showing 18 changed files with 2,197 additions and 476 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled

on:
# Runs on pushes targeting the default branch
push:
branches: ["devel"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ The Red Hat Ansible Automation Workshops project is intended for effectively dem
| Workshop | Public Deck | Red Hat Internal | Exercises | Workshop Type Var |
|---|---|---|---|---|
| **[Ansible Red Hat Enterprise Linux Workshop](./exercises/ansible_rhel)** <br> focused on automating Linux platforms like Red Hat Enterprise Linux | [PDF](./decks/ansible_rhel.pdf) | [Google Source](https://docs.google.com/presentation/d/1O2Gj5r_fhjM5Pi5FizrZRInmZ37IlpeKPTP6jSZxEKs/edit?usp=sharing) | [Exercises](./exercises/ansible_rhel) | `workshop_type: rhel` |
| **[Ansible Config as Code Workshop](./exercises/ansible_config_as_code)** <br> focused on config as code for AAP | [PDF](./decks/config_as_code.pdf) | [Google Source](https://docs.google.com/presentation/d/1F6W8p0MG878AC3Q1CsNZHfhX5VkEyGKbwDHACQtoLPI) | [Exercises](./exercises/ansible_config_as_code) | `workshop_type: configascode` |
| **[Ansible Network Automation Workshop](./exercises/ansible_network)** <br> focused on router and switch platforms like Arista, Cisco, Juniper | [PDF](./decks/ansible_network.pdf) | [Google Source](https://docs.google.com/presentation/d/1PIT-kGAGMVEEK8PsuZCoyzFC5CIzLBwdnftnUsdUNWQ/edit?usp=sharing) | [Exercises](./exercises/ansible_network) | `workshop_type: network` |
| **[Ansible Windows Automation Workshop](./exercises/ansible_windows)** <br> focused on automation of Microsoft Windows | [PDF](./decks/ansible_windows.pdf) | [Google Source](https://docs.google.com/presentation/d/1RO5CQiCoqLDES1NvTI_1fQrR-oWM1NuW-uB0JRvtJzE) | [Exercises](./exercises/ansible_windows) | `workshop_type: windows` |
| **[Smart Management Automation Workshop](./exercises/ansible_smart_mgmt)** <br> focused on automation of security and lifecycle management with Red Hat Satellite Server | [PDF](./decks/ansible_smart_mgmt.pdf) | [Google Source](https://docs.google.com/presentation/d/135lid9AeSioN4bJexBbv9q0fkJwDibpUQg8aeYjxzTY) | [Exercises](./exercises/ansible_smart_mgmt) | `workshop_type: smart_mgmt`
Expand Down Expand Up @@ -59,7 +58,7 @@ The Red Hat Ansible Automation Workshops project is intended for effectively dem

## Slack Community

- [Join us on Ansible Network Slack](https://join.slack.com/t/ansiblenetwork/shared_invite/zt-3zeqmhhx-zuID9uJqbbpZ2KdVeTwvzw)
- [Join us on the Ansible Forum](https://forum.ansible.com/)

## E-Books

Expand Down
28 changes: 13 additions & 15 deletions exercises/ansible_rhel/1.5-handlers/README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@

## Table des Matières

- [Objectif](#objectif)
- [Guide](#guide)
- [Étape 1 - Comprendre les Conditionnels, Gestionnaires et Boucles](#étape-1---comprendre-les-conditionnels-gestionnaires-et-boucles)
- [Étape 2 - Conditionnels](#étape-2---conditionnels)
- [Étape 3 - Gestionnaires](#étape-3---gestionnaires)
- [Étape 4 - Boucles](#étape-4---boucles)
- [Exercice de l'Atelier - Conditionnels, Gestionnaires et Boucles](#exercice-de-latelier---conditionnels-gestionnaires-et-boucles)
- [Exercices de l'Atelier - Utilisation des Conditionnels, Gestionnaires et Boucles](#exercices-de-latelier---utilisation-des-conditionnels-gestionnaires-et-boucles)
- [Table des Matières](#table-des-matières)
- [Objectif](#objectif)
- [Guide](#guide)
- [Étape 1 - Comprendre les Conditionnels, Gestionnaires et Boucles](#étape-1---comprendre-les-conditionnels-gestionnaires-et-boucles)
- [Étape 2 - Conditionnels](#étape-2---conditionnels)
- [Étape 3 - Gestionnaires](#étape-3---gestionnaires)
- [Étape 4 - Boucles](#étape-4---boucles)

## Objectif

Expand Down Expand Up @@ -66,7 +69,7 @@ Ajoutons à notre playbook system_setup.yml la capacité d'installer le Serveur
when: inventory_hostname in groups['web']
```
<!-- {% raw %} -->
<!-- {% endraw %} -->
Dans cet exemple, `inventory_hostname in groups['web']` est la déclaration conditionnelle. `inventory_hostname` fait référence au nom de l'hôte actuel sur lequel Ansible travaille dans le playbook. La condition vérifie si cet hôte fait partie du groupe web défini dans votre fichier d'inventaire. Si c'est vrai, la tâche s'exécutera et installera Apache sur cet hôte.

Expand Down Expand Up @@ -113,7 +116,7 @@ Disons que nous voulons nous assurer que le pare-feu est correctement configuré
```

<!-- {% raw %} -->
<!-- {% endraw %} -->

Le gestionnaire Recharger le Pare-feu est déclenché uniquement si la tâche "Autoriser le trafic HTTPS sur les serveurs web" effectue des modifications.

Expand Down Expand Up @@ -192,7 +195,7 @@ Dans le playbook system_setup.yml original de l'exercice 1.4, nous avions une t
create_home: true
```
<!-- {% raw %} -->
<!-- {% endraw %} -->

Maintenant, modifions cette tâche pour créer plusieurs utilisateurs à l'aide d'une boucle :

Expand All @@ -210,16 +213,13 @@ Maintenant, modifions cette tâche pour créer plusieurs utilisateurs à l'aide
- carol
```
<!-- {% raw %} -->
<!-- {% raw %} -->
<!-- {% endraw %} -->
Qu'est-ce qui a changé ?
1. Directive de Boucle : Le mot-clé loop est utilisé pour itérer sur une liste d'éléments. Dans ce cas, la liste contient les noms des utilisateurs que nous souhaitons créer : alice, bob et carol.
2. Création d'Utilisateurs avec Boucle : Au lieu de créer un seul utilisateur, la tâche modifiée itère maintenant sur chaque élément de la liste de boucle. Le placeholder `{{ item }}` est dynamiquement remplacé par chaque nom d'utilisateur dans la liste, de sorte que le module ansible.builtin.user crée chaque utilisateur à son tour.
<!-- {% raw %} -->

Lorsque vous exécutez le playbook mis à jour, cette tâche est exécutée trois fois, une fois pour chaque utilisateur spécifié dans la boucle. C'est une manière efficace de gérer les tâches répétitives avec des données d'entrée variables.

Expand Down Expand Up @@ -268,5 +268,3 @@ node3 : ok=7 changed=1 unreachable=0 failed=0 s
[Exercise précédent](../1.4-variables/README.fr.md) - [Exercise suivant](../1.6-templates/README.fr.md)

[Cliquez ici pour revenir à l'atelier Ansible pour Red Hat Enterprise Linux](../README.fr.md)


22 changes: 12 additions & 10 deletions exercises/ansible_rhel/1.6-templates/README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@

## Table des Matières

- [Objectif](#objectif)
- [Guide](#guide)
- [Étape 1 - Introduction à la Templatisation Jinja2](#étape-1---introduction-à-la-templatisation-jinja2)
- [Étape 2 - Création de Votre Premier Modèle](#étape-2---création-de-votre-premier-modèle)
- [Étape 3 - Déploiement du Modèle avec un Playbook](#étape-3---déploiement-du-modèle-avec-un-playbook)
- [Étape 4 - Exécution du Playbook](#étape-4---exécution-du-playbook)
- [Exercice de l'Atelier - Modèles](#exercice-de-latelier---modèles)
- [Table des Matières](#table-des-matières)
- [Objectif](#objectif)
- [Guide](#guide)
- [Étape 1 - Introduction à la Templatisation Jinja2](#étape-1---introduction-à-la-templatisation-jinja2)
- [Étape 2 - Création de Votre Premier Modèle](#étape-2---création-de-votre-premier-modèle)
- [Configuration du Répertoire des Modèles :](#configuration-du-répertoire-des-modèles-)
- [Développement du Modèle MOTD :](#développement-du-modèle-motd-)
- [Étape 3 - Déploiement du Modèle avec un Playbook](#étape-3---déploiement-du-modèle-avec-un-playbook)
- [Étape 4 - Exécution du Playbook](#étape-4---exécution-du-playbook)

## Objectif

Expand All @@ -26,7 +30,7 @@ Ansible utilise Jinja2, un langage de templatisation largement utilisé pour Pyt

<!-- {% raw %} -->
Les modèles se terminent par une extension `.j2` et mélangent du contenu statique avec des espaces réservés dynamiques entourés de `{{ }}`.
<!-- {% raw %} -->
<!-- {% endraw %} -->

Dans l'exemple suivant, créons un modèle pour le Message du Jour (MOTD) qui inclut des informations dynamiques sur l'hôte.

Expand All @@ -50,7 +54,7 @@ OS : {{ ansible_distribution }} {{ ansible_distribution_version }}
Architecture : {{ ansible_architecture }}
```

<!-- {% raw %} -->
<!-- {% endraw %} -->

Ce modèle affiche dynamiquement le nom d'hôte, la distribution de l'OS, la version et l'architecture de chaque hôte géré.

Expand Down Expand Up @@ -127,5 +131,3 @@ Dernière connexion : Lun 29 Jan 16:30:31 2024 depuis 10.5.1.29
[Exercise précédent](../1.5-handlers/README.fr.md) - [Exercise suivant](../1.7-role/README.fr.md)

[Cliquez ici pour revenir à l'atelier Ansible pour Red Hat Enterprise Linux](../README.fr.md)


48 changes: 24 additions & 24 deletions exercises/rhdp_auto_satellite/3-convert2rhel/1.1-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
- [Objectives](#objectives)
- [Guide](#guide)
- [Your Lab Environment](#your-lab-environment)
- [Step 1 - Access the Environment](#step-1---access-the-environment)
- [Step 2 - Open a Terminal Session](#step-2---open-a-terminal-session)
- [Step 3 - Access the AAP Web UI](#step-3---access-the-aap-web-ui)
- [Step 1 - Access the AAP Web UI](#step-1---access-the-aap-web-ui)
- [Step 2 - Access the Visual Studio Code Web UI](#step-2---access-the-visual-studio-code-web-ui)
- [Step 3 - Open a Terminal Session](#step-3---open-a-terminal-session)
- [Step 4 - Access the Satellite Web UI](#step-4---access-the-satellite-web-ui)
- [Step 5 - Access the RHEL Web Console](#step-5---access-the-centos-web-console)
- [Step 6 - Challenge Labs](#step-6---challenge-labs)
Expand Down Expand Up @@ -38,7 +38,21 @@ The workshop is provisioned with a pre-configured lab environment. You will have
| Managed Host 5 - CentOS/OracleLinux | node5 |
| Managed Host 6 - CentOS/OracleLinux | node6 |

### Step 1 - Access the Environment
### Step 1 - Access the AAP Web UI

The AAP Web UI is where we will go to submit and check the status of the Ansible playbook jobs we will use to automate the CentOS conversion workflow.

- Let's open the AAP Web UI in a new web browser tab using the "Console" link under "Red Hat Ansible Automation Controller" on the workshop launch page. For example:

![Example link to AAP Web UI](images/aap_link.png)

- Enter the username `admin` and the password provided. This will bring you to your AAP Web UI dashboard like the example below:

![Example AAP Web UI dashboard](images/aap_console_example.svg)

- We will learn more about how to use the AAP Web UI in the next exercise.

### Step 2 - Access the Visual Studio Code Web UI

We will use Visual Studio Code (VS Code) as it provides a convenient and intuitive way to use a web browser to edit files and access terminal sessions. If you are a command line hero, direct SSH access is available if VS Code is not to your liking. There is a short YouTube video to explain if you need additional clarity: <a href="https://youtu.be/Y_Gx4ZBfcuk">Ansible Workshops - Accessing your workbench environment</a>.

Expand All @@ -52,7 +66,7 @@ We will use Visual Studio Code (VS Code) as it provides a convenient and intuiti
>
> A welcome wizard may appear to guide you through configuring your VS Code user experience. This is optional as the default settings will work fine for this workshop. Feel free to step though the wizard to explore the VS code bells and whistles or you may just skip it.
### Step 2 - Open a Terminal Session
### Step 3 - Open a Terminal Session

Terminal sessions provide access to the OS commands and utilities that will help us understand what's going on "behind the curtain" when the CentOS conversion automation is doing its thing.

Expand All @@ -68,20 +82,6 @@ Terminal sessions provide access to the OS commands and utilities that will help

- In the example above, the command `ssh node4` connects us to a new session on the node4 host. Then the commands `cat /etc/redhat-release` and `uname -r` are used to output the OS release information `CentOS Linux release 7.9.2009 (Core)` and kernel version `3.10.0-1160.102.1.el7.x86_64` from that host.

### Step 3 - Access the AAP Web UI

The AAP Web UI is where we will go to submit and check the status of the Ansible playbook jobs we will use to automate the CentOS conversion workflow.

- Let's open the AAP Web UI in a new web browser tab using the "Console" link under "Red Hat Ansible Automation Controller" on the workshop launch page. For example:

![Example link to AAP Web UI](images/aap_link.png)

- Enter the username `admin` and the password provided. This will bring you to your AAP Web UI dashboard like the example below:

![Example AAP Web UI dashboard](images/aap_console_example.svg)

- We will learn more about how to use the AAP Web UI in the next exercise.

### Step 4 - Access the Satellite Web UI

The Satellite Web UI is where we will go to review the Lifecycle Environments, Content Views and Activation Keys configured on the Satellite, as well as tracking the status of the CentOS hosts as we proceed through the conversion workflow through to when they become RHEL hosts.
Expand All @@ -94,17 +94,17 @@ The Satellite Web UI is where we will go to review the Lifecycle Environments, C

![Example Satellite Web UI dashboard](images/satellite_console_example.png)

### Step 5 - Access the RHEL Web Console
### Step 5 - Access the Web Console

We will use the RHEL Web Console to review the results of the Convert2RHEL pre-conversion analysis reports we generate for our three-tier app servers.
We will use the Web Console to review the results of the Convert2RHEL pre-conversion analysis reports we generate for our three-tier app servers.

- Open a new web browser tab using the link under "RHEL Web Console Interactive Server Admin Interface" on the workshop launch page. For example:

![Example link to RHEL Web Console](images/cockpit_link.png)
![Example link to Web Console](images/cockpit_link.png)

- Enter the username `student` and the password provided. This will bring you to a RHEL Web Console Overview page like the example below:
- Enter the username `student` and the password provided. This will bring you to a Web Console Overview page like the example below:

![Example RHEL Web Console](images/cockpit_example.png)
![Example Web Console](images/cockpit_example.png)

- We will revisit the RHEL Web Console when we are ready to review our pre-conversion reports in an upcoming exercise.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,36 @@ This use-case will focus on conversion from CentOS (though this could be another

### Step 3 - Install Three Tier Application

- In the AAP Web UI, navigate to Resources > Templates by clicking on "Templates" under the "Resources" group in the navigation menu. This will bring up a list of job templates that can be used to run playbook jobs on target hosts:
- In the AAP Web UI, navigate to Resources > Templates by clicking on "Templates" under the "Resources" group in the navigation menu. This will bring up a list of job templates that can be used to run playbook jobs on target hosts.

![Job templates listed on AAP Web UI](images/aap_templates.png)
![Job templates on AAP Web UI with EC2 filter](images/aap_templates_ec2_filter.png)

- In the filter box, enter `EC2` and then click the magnifying glass. This will bring up a list of job templates specific to AWS/EC2 automation:

![EC2 Job templates Instance Action](images/aap_templates_ec2_instance_action.png)

- Click ![launch](images/convert2rhel-aap2-launch.png) to the right of **EC2 / Instance action**:

![EC2 Instance Action Other](images/ec2_instance_action_other.png)

- For the `Launch | EC2 / Instance action - Other prompts` dialog, click **Next**.

![EC2 Instance Action Survey](images/ec2_instance_action_survey.png)

- On the `Launch | EC2 / Instance action - Survey` dialog:
- For `Select EC2 instance action` select "start".
- For `Select OS target` select "CentOS7".
- For `Select Environment stage` select "Dev".

Then, click **Next**.

![EC2 Instance Action Launch](images/ec2_instance_action_launch.png)

- On the `Launch | EC2 / Instance action - Preview` dialog, review and then click **Launch**. Once the `EC2 / Instance action` job has completed, our CentOS7 instances will be started and available for installing the three tier application stack.

- In the AAP Web UI, navigate to Resources > Templates by clicking on "Templates" under the "Resources" group in the navigation menu. This will bring up a list of job templates.

![Job templates on AAP Web UI with EC2 filter](images/aap_templates.png)

- Click ![launch](images/convert2rhel-aap2-launch.png) to the right of **CONVERT2RHEL / 98 - Three Tier App deployment** to launch the job.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1e9d3e5

Please sign in to comment.