-
Notifications
You must be signed in to change notification settings - Fork 118
Changed selinux_packages for CentOS 8 #51
base: master
Are you sure you want to change the base?
Conversation
A simpler solution would be to just edit |
I've suggested a very similar approach in the issue #54 but also only tested on CentOS 8, though I don't see why there should be a difference with RHEL 8. |
And I realise that it is just a different approach to previous PR #46 |
Needed for Fedora 32 server too |
I think it would be better to detect the python version on the target and use that to determine which python package should be installed. For example: - name: Install SELinux python package
package:
name: "{{ samba_python2_selinux_packages }}"
state: present
when: ansible_selinux is defined and ansible_selinux.status == 'enabled' and ansible_python.version.major < 3
tags: samba
- name: Install SELinux python3 package
package:
name: "{{ samba_selinux_packages }}"
state: present
when: ansible_selinux is defined and ansible_selinux.status == 'enabled' and ansible_python.version.major == 3
tags: samba where samba_selinux_packages:
- python3-libsemanage
samba_python2_selinux_packages:
- libsemanage-python @bertvv do you need some help in maintaining this role? |
@aairey basing the decision on the python version could be a good idea, but I don't think it works under ArchLinux and your code could be made simpler:
where the variable is a dictionary of lists:
Once Python 4 is out, you only add a new key to the dictionary. |
Did you run gather_facts for the target node before reaching this point? |
Nothing to do with facts, I didn't try as I don't have ArchLinux, but I couldn't find an ArchLinux package containing the name |
@ericzolf it wasn't clear why "it did not work" on ArchLinux from your message. Anyways, I think you need |
The selinux_package libsemanage-python is replaced by python3-libsemanage in CentOS 8.
I had to tweak the including of OS specific variables to handle different versions. Possibly, it is the same for RHEL 8, but I have no chance to test it, and it is a bit strange to make an include which mixes ansible_os_family with the version of the distribution.