cancel
Showing results for 
Search instead for 
Did you mean: 
abbashussain
Mission Specialist
Mission Specialist
  • 276 Views

RH294 ansible-navigator syntax Error when try to run timesync role or selinux setup urgent help

Dear Community , 

Please help me I am using rhel 9.0 and doing practice ex294 v9 exam.

Same playbook works fine with ansible-playbook command while aways through error using ansible-navigator. Please help to fix here is details of my configurations.

[devops@controller ansible]$ ansible --version
ansible [core 2.14.9]
config file = /home/devops/ansible/ansible.cfg
configured module search path = ['/home/devops/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
ansible collection location = /home/devops/ansible/collections:/home/devops/ansible/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.9.10 (main, Feb 9 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True
[devops@controller ansible]$ ansible-navigator --version
ansible-navigator 2.1.0
[devops@controller ansible]$ cat ansible-navigator.yml
---
ansible-navigator:
execution-environment:
image: registry.redhat.io/ansible-automation-platform-22/ee-supported-rhel8:latest
pull:
policy: never
playbook-artifact:
enable: false


[devops@controller ansible]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.0 (Plow)
[devops@controller ansible]$ cat ansible.cfg
[defaults]
remote_user = devops
ask_pass = false
inventory = /home/devops/ansible/inventory
roles_path = /home/devops/ansible/roles/:/usr/share/ansible/roles
collections_path = /home/devops/ansible/collections/:usr/share/ansible/collections/

[privilege_escalation]
become = true
become_method = sudo
become_user = root
become_ask_pass = false

=============================================================

Playbook

---
- name: get time from ntp servers
hosts: all
become: true
remote_user: devops
vars:
   timesync_ntp_servers:
      - hostname: 172.16.24.20
        iburst: true
roles:
 - rhel-system-roles.timesync

=====================================

[devops@controller ansible]$ ansible-playbook time.yml --syntax-check

playbook: time.yml

[devops@controller ansible]$ ansible-navigator run time.yml -m stdout --syntax-check
ERROR! the role 'rhel-system-roles.timesync' was not found in /home/devops/ansible/roles:/home/devops/ansible/roles:/usr/share/ansible/roles:/home/devops/ansible

The error appears to be in '/home/devops/ansible/time.yml': line 11, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

roles:
- rhel-system-roles.timesync
^ here
Please review the log for errors.

[devops@controller ansible]$ head ansible-navigator.log
2024-02-07T04:38:11.068766+00:00 WARNING 'ansible_navigator.image_manager.puller._log_message' Image inspection failed, image assumed to be corrupted or missing
2024-02-07T04:42:22.907417+00:00 ERROR 'ansible_navigator.actions.collections._parse' /usr/share/ansible/collections/ansible_collections/ansible/network/roles/resource_manager/meta/argument_specs.yml Failed to find argument_specs.yml for role in ansible.network.
2024-02-07T04:42:22.910160+00:00 ERROR 'ansible_navigator.actions.collections._parse' /usr/share/ansible/collections/ansible_collections/ansible/network/roles/resource_manager/meta/main.yml Failed to find main.yml for role in ansible.network.
2024-02-07T04:42:22.910209+00:00 ERROR 'ansible_navigator.actions.collections._parse' /usr/share/ansible/collections/ansible_collections/redhat/insights/roles/compliance/meta/argument_specs.yml Failed to find argument_specs.yml for role in redhat.insights.
2024-02-07T04:42:22.910236+00:00 ERROR 'ansible_navigator.actions.collections._parse' /usr/share/ansible/collections/ansible_collections/redhat/insights/roles/insights_client/meta/argument_specs.yml Failed to find argument_specs.yml for role in redhat.insights.
2024-02-07T04:42:22.910259+00:00 ERROR 'ansible_navigator.actions.collections._parse' /usr/share/ansible/collections/ansible_collections/redhat/rhv/roles/cluster_upgrade/meta/argument_specs.yml Failed to find argument_specs.yml for role in redhat.rhv.
2024-02-07T04:42:22.910280+00:00 ERROR 'ansible_navigator.actions.collections._parse' /usr/share/ansible/collections/ansible_collections/redhat/rhv/roles/cluster_upgrade/meta/main.yml Failed to find main.yml for role in redhat.rhv.
2024-02-07T04:42:22.910302+00:00 ERROR 'ansible_navigator.actions.collections._parse' /usr/share/ansible/collections/ansible_collections/redhat/rhv/roles/disaster_recovery/meta/argument_specs.yml Failed to find argument_specs.yml for role in redhat.rhv.
2024-02-07T04:42:22.910323+00:00 ERROR 'ansible_navigator.actions.collections._parse' /usr/share/ansible/collections/ansible_collections/redhat/rhv/roles/disaster_recovery/meta/main.yml Failed to find main.yml for role in redhat.rhv.
2024-02-07T04:42:22.910343+00:00 ERROR 'ansible_navigator.actions.collections._parse' /usr/share/ansible/collections/ansible_collections/redhat/rhv/roles/engine_setup/meta/argument_specs.yml Failed to find argument_specs.yml for role in redhat.rhv.
[devops@controller ansible]$

anyone please guide how to fix this issue and i can run this using ansible-navigator

 

 

1 Reply
Chetan_Tiwary_
Moderator
Moderator
  • 173 Views

Hello @abbashussain !
Refer this  blog : https://www.redhat.com/en/blog/introduction-rhel-system-roles 

I was able to reproduce the error :

Chetan_Tiwary__0-1710189620867.png

and then resolved it using the correct role name :

Chetan_Tiwary__1-1710189711464.png

I installed the roles using : ansible-galaxy collection install -p collections/ redhat-rhel_system_roles-1.19.3.tar.gz

0 Kudos
Join the discussion
You must log in to join this conversation.