cancel
Showing results for 
Search instead for 
Did you mean: 
khokha
Flight Engineer
Flight Engineer
  • 691 Views

Hello everyone,

I installed redhat roles using dnf install rhel-system-roles command.

my roles_path= /usr/share/ansible/roles:/etc/ansible/roles:/home/user/roles

when i do ansible-galaxy list the roles exist.

but when i run the playbook i get this error

error-role.png

my code for the role is:

code.png

i even tried using it in roles section but it gives error with syntax-check even before i run the playbook.

I tried writing different syntax: rhel-system-roles.selinux but the same error.

 

Thanks

1 Solution

Accepted Solutions
Travis
Moderator
Moderator
  • 673 Views

Get the output of the following:

ansible-galaxy collection list

ansible-galaxy list

If you installed from the RPM, it is from the collection or as the independent role depending on how you installed it. Keep in mind that roles and collections installed from RPM packages differ a little bit from a role installed directly using the Ansible Galaxy command. The error indicates it can't find the role, so I would try the above commands and I would also list out the directory 

/usr/share/ansible/roles/ (where the RPM will install)

 

rhel-system-roles.selinux (Independent Role name)

or

redhat.rhel_system_roles.selinxrhel-system-roles.selinux (FQCN)

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training

View solution in original post

2 Replies
Travis
Moderator
Moderator
  • 674 Views

Get the output of the following:

ansible-galaxy collection list

ansible-galaxy list

If you installed from the RPM, it is from the collection or as the independent role depending on how you installed it. Keep in mind that roles and collections installed from RPM packages differ a little bit from a role installed directly using the Ansible Galaxy command. The error indicates it can't find the role, so I would try the above commands and I would also list out the directory 

/usr/share/ansible/roles/ (where the RPM will install)

 

rhel-system-roles.selinux (Independent Role name)

or

redhat.rhel_system_roles.selinxrhel-system-roles.selinux (FQCN)

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
khokha
Flight Engineer
Flight Engineer
  • 652 Views

Hi @Travis 

Thanks for your reply i downloaded the role using dnf install rhel-system-roles.

c1.pngc2.pngfor the command of ansible-galaxy list the remainig roles aren't shown in the picture but rhel-system-roles.selinux exists.

c3.pngc4.png

sorry the output doesn't fit into single picture.

 

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