Skip to content

Latest commit

 

History

History
 
 

1.1-setup

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Workshop Exercise - Check the Prerequisites

Read this in other languages:
uk English, japan日本語, brazil Portugues do Brasil, france Française,Español Español.

Table of Contents

Objective

  • Understand the lab topology and how to access the environment.
  • Understand how to work the workshop exercises
  • Understand challenge labs

These first few lab exercises will be exploring the command-line utilities of the Ansible Automation Platform. This includes

  • ansible-navigator - a command line utility and text-based user interface (TUI) for running and developing Ansible automation content.
  • ansible-core - the base executable that provides the framework, language and functions that underpin the Ansible Automation Platform. It also includes various cli tools like ansible, ansible-playbook and ansible-doc. Ansible Core acts as the bridge between the upstream community with the free and open source Ansible and connects it to the downstream enterprise automation offering from Red Hat, the Ansible Automation Platform.
  • Execution Environments - not specifically covered in this workshop because the built-in Ansible Execution Environments already included all the Red Hat supported collections which includes all the collections we use for this workshop. Execution Environments are container images that can be utilized as Ansible execution.
  • ansible-builder - not specifically covered in this workshop, ansible-builder is a command line utility to automate the process of building Execution Environments.

If you need more information on new Ansible Automation Platform components bookmark this landing page https://red.ht/AAP-20

Guide

Your Lab Environment

In this lab you work in a pre-configured lab environment. You will have access to the following hosts:

Role Inventory name
Ansible Control Host ansible-1
Managed Host 1 node1
Managed Host 2 node2
Managed Host 3 node3

Step 1 - Access the Environment

It is highly encouraged to use Visual Studio Code to complete the workshop exercises. Visual Studio Code provides:
  • A file browser
  • A text editor with syntax highlighting
  • A in-browser terminal
Direct SSH access is available as a backup, or if Visual Studio Code is not sufficient to the student. There is a short YouTube video provided if you need additional clarity: Ansible Workshops - Accessing your workbench environment.
  • Connect to Visual Studio Code from the Workshop launch page (provided by your instructor). The password is provided below the WebUI link.

    launch page

  • Type in the provided password to connect.

    login vs code

    • Open the rhel-workshop directory in Visual Studio Code:

Step 2 - Using the Terminal

  • Open a terminal in Visual Studio Code:

    picture of new terminal

Navigate to the rhel-workshop directory on the Ansible control node terminal.

[student<X>@ansible-1 ~]$ cd ~/rhel-workshop/
[student<X>@ansible-1 rhel-workshop]$ pwd
/home/student<X>/rhel-workshop
[student<X>@ansible-1 rhel-workshop]$
  • ~ - the tilde in this context is a shortcut for the home directory, i.e. /home/student<X>
  • cd - Linux command to change directory
  • pwd - Linux command for print working directory. This will show the full path to the current working directory.

Step 3 - Examining Execution Environments

Run the ansible-navigator command with the images argument to look at execution environments configured on the control node:

$ ansible-navigator images

ansible-navigator images

Note: The output you see might differ from the above output

This command gives you information about all currently installed Execution Environments or EEs for short. Investigate an EE by pressing the corresponding number. For example pressing 2 with the above example will open the ee-supported-rhel8 execution environment:

ee main menu

Selecting 2 for Ansible version and collections will show us all Ansible Collections installed on that particular EE, and the version of ansible-core:

ee info

Step 4 - Examining the ansible-navigator configuration

Either use Visual Studio Code to open or use the cat command to view the contents of the ansible-navigator.yml file. The file is located in the home directory:

$ cat ~/.ansible-navigator.yml
---
ansible-navigator:
  ansible:
    inventories:
    - /home/student<X>/lab_inventory/hosts

  execution-environment:
    image: registry.redhat.io/ansible-automation-platform-20-early-access/ee-supported-rhel8:2.0.0
    enabled: true
    container-engine: podman
    pull-policy: missing
    volume-mounts:
    - src: "/etc/ansible/"
      dest: "/etc/ansible/"

Note the following parameters within the ansible-navigator.yml file:

  • inventories: shows the location of the ansible inventory being used
  • execution-environment: where the default execution environment is set

For a full listing of every configurable knob checkout the documentation

Step 5 - Challenge Labs

You will soon discover that many chapters in this lab guide come with a "Challenge Lab" section. These labs are meant to give you a small task to solve using what you have learned so far. The solution of the task is shown underneath a warning sign.


Navigation


{% if page.url contains 'ansible_rhel_90' %} Next Exercise {% else %} Next Exercise {% endif %}

Click here to return to the Ansible for Red Hat Enterprise Linux Workshop