Read this in other languages:
English,
日本語,
Portugues do Brasil,
Française,
Español.
- 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
andansible-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
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 |
It is highly encouraged to use Visual Studio Code to complete the workshop exercises. Visual Studio Code provides:
|
---|
-
Connect to Visual Studio Code from the Workshop launch page (provided by your instructor). The password is provided below the WebUI link.
-
Type in the provided password to connect.
- Open the
rhel-workshop
directory in Visual Studio Code:
- Open the
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 directorypwd
- Linux command for print working directory. This will show the full path to the current working directory.
Run the ansible-navigator
command with the images
argument to look at execution environments configured on the control node:
$ 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:
Selecting 2
for Ansible version and collections
will show us all Ansible Collections installed on that particular EE, and the version of ansible-core
:
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 usedexecution-environment
: where the default execution environment is set
For a full listing of every configurable knob checkout the documentation
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