These first few lab exercises will be exploring the command-line utilities of the Ansible Automation Platform. This includes
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-builderis 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:
|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-workshopdirectory 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.
cd- Linux command to change directory
pwd- Linux command for print working directory. This will show the full path to the current working directory.
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:
Ansible version and collections will show us all Ansible Collections installed on that particular EE, and the version of
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
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
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.