Error in RHEL System Roles [SELinux]

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]: 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

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]: 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?