# Error in RHEL System Roles \[SELinux\]

**URL:** <https://forum.ansible.com/t/error-in-rhel-system-roles-selinux/36083>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [December 8, 2021, 5:00pm UTC](https://forum.ansible.com/t/error-in-rhel-system-roles-selinux/36083 "2021-12-08T17:00:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taha\_Adel](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Taha\_Adel](https://forum.ansible.com/u/Taha_Adel)\
**Post date:** [December 8, 2021, 5:00pm UTC](https://forum.ansible.com/t/error-in-rhel-system-roles-selinux/36083/1 "2021-12-08T17:00:33Z")

</div>

Hi Team,

I’m trying to practice rhel-system-roles and when I run the selinux roles, I’m getting the following error message

fatal: [[ansible-01.example.com](http://ansible-01.example.com)]: FAILED! =\> {“msg”: “The conditional check ‘ansible\_python\_version is version(‘3’, ‘\<’)’ failed. The error was: Version comparison: ‘ansible\_python\_version’ is undefined\n\nThe error appears to be in ‘/usr/share/ansible/roles/rhel-system-roles.selinux/tasks/main.yml’: line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n—\n- name: Install SELinux python2 tools\n ^ here\n”}

The error is related to the first task in the role that should install SElinux package depending on the python version on the managed hosts, but the ansible\_python\_version variable is not defined. My question is this variable an ansible fact that should be gathered from the managed host or it’s just a bug or what?

Thanks

---

<div class="post-metadata">

**Author:** ![Richard\_Megginson](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/richard_megginson/32/4540_2.png) [@Richard\_Megginson](https://forum.ansible.com/u/Richard_Megginson)\
**Post date:** [December 8, 2021, 5:05pm UTC](https://forum.ansible.com/t/error-in-rhel-system-roles-selinux/36083/2 "2021-12-08T17:05:12Z")

</div>

> Hi Team,
> 
> I’m trying to practice rhel-system-roles and when I run the selinux roles, I’m getting the following error message
> 
> fatal: [[ansible-01.example.com](http://ansible-01.example.com)]: FAILED! =\> {“msg”: “The conditional check ‘ansible\_python\_version is version(‘3’, ‘\<’)’ failed. The error was: Version comparison: ‘ansible\_python\_version’ is undefined\n\nThe error appears to be in ‘/usr/share/ansible/roles/rhel-system-roles.selinux/tasks/main.yml’: line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n—\n- name: Install SELinux python2 tools\n ^ here\n”}
> 
> The error is related to the first task in the role that should install SElinux package depending on the python version on the managed hosts, but the ansible\_python\_version variable is not defined. My question is this variable an ansible fact that should be gathered from the managed host or it’s just a bug or what?

What version of rhel-system-roles are you using? What version of ansible are you using? What is your controller node platform?
