Tracy_Baker
Starfighter Starfighter
Starfighter
  • 714 Views

Issues with Red Hat Enterprise Linux Automation with Ansible 9.0 (RH294), guided lab 3.6

Red Hat Enterprise Linux Automation with Ansible 9.0 (RH294), guided lab 3.6 has a few issues.

The main one is the use of Ansible modules. In section 2.5, there was an important note on this:

Important

In earlier versions of Ansible, modules had to be included with Ansible and were named using just their short name, for example the copy module. Ansible might still try to resolve short names if your playbooks use them. However, to avoid errors, it is a good practice to use FQCNs in new playbooks.

 

The problem is that all the module names in guided lab 3.6 are using their short names - not the recommended long names. Two examples are (all tasks use short names):

---
- name: Display ansible_facts
  hosts: webserver
  tasks:
    - name: Display facts
      debug:
        var: ansible_facts

and:

 tasks:
    - name: Install the required package
      dnf:
        name: "{{ ansible_facts['ansible_local']['custom']['general']['package'] }}"
        state: latest

----------

The next issue is this:

8.2 Run the check_httpd.yml playbook and verify that the httpd service is not currently running on the servera machine.

[student@workstation data-facts]$ ansible-navigator run \ > -m stdout check_httpd.yml
...output omitted...
TASK [Check httpd status] ****************************************************** fatal: [servera.lab.example.com]: FAILED! => {"changed": false, "msg": "Could not find the requested service httpd: host"} PLAY RECAP ********************************************************************* servera.lab.example.com : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 Please review the log for errors.

 

The problem here is that the output from the playbook is not what is shown (perhaps this is from an earlier version of Ansible?). Instead, it looks like this:

Tracy_Baker_0-1684512509798.png

 

The entire Guided Exercise feels as if it were simply copied from an earlier version of RH294 (although it isn't, because this lab uses dnf and all 8.x versions use yum, so that tells be that someone had to have (re)written the exercise).

When admonishing learners, "to avoid errors, it is a good practice to use FQCNs in new playbooks," it is a good idea to make all of the course content, especially Guided Exercises, follow the advice.

 

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
Labels (4)
1 Reply
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 667 Views

The short-name module "problem" exists in lab 5.5, too.

Identify the facts on serverb.lab.example.com that show its total amount of system memory, and the number of processors it has.

 

[student@workstation file-review]$ cat serverb_facts.yml
---
- name: Display ansible_facts
  hosts: serverb.lab.example.com
  tasks:
  - name: Display facts
    debug:
      var: ansible_facts

 

debug: not ansible.builtin.debug:

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
Join the discussion
You must log in to join this conversation.