Read this in other languages:
English,
日本語,
Portugues do Brasil,
Française,
Español.
These first few lab exercises will be exploring the command-line utilities of the Ansible Automation Platform. This includes
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.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.
rhel-workshop
directory in Visual Studio Code:Open a terminal in Visual Studio Code:
Navigate to the rhel-workshop
directory on the Ansible control node terminal.
[student@ansible-1 ~]$ cd ~/rhel-workshop/
[student@ansible-1 rhel-workshop]$ pwd
/home/student/rhel-workshop
[student@ansible-1 rhel-workshop]$
~
- the tilde in this context is a shortcut for the home directory, i.e. /home/student
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:
inventory:
entries:
- /home/student/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 setFor 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
Click here to return to the Ansible for Red Hat Enterprise Linux Workshop