Red Hat Enterprise Linux Automation with Ansible 9.0 (RH294), lab 9.11, there's a bit of an inconsistency.
First, there is this, which creates the username and groups variables that will be used a bit later in the lab:
Then there is this:
The issue is this: Step 2.1 creates the groups variable; however, Step 2.3 does not use it - instead, it hard codes in the webadmin group name. It uses username, but not groups. If groups wasn't going to used in the playbook, why define it?
I'd suggest that the task be changed to this, so the groups variable gets used:
- name: Create user accounts
ansible.builtin.user:
name: "{{ item['username'] }}"
groups: "{{ item['groups'] }}"
loop: "{{ users }}"
The lab's grading script works just fine with this change.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.