ansible-vault
ansible-vault copied to clipboard
fix: set vault_os_packages for RedHat
#302
Is it possible to handle package installation conditionally like this ? This method comes from ansible-community.ansible-nomad role.
I think that RedHat8.yml can be removed too with this solution.
Yes this can be done, but instead of having to define the name and version of every rhel based distro you can simply check if the system is running python 2 or 3. Something like this:
- "{{ 'libselinux-python' if ansible_python_version is version('3', '<') else 'python3-libselinux' }}"
And yes while you are at it, it would be good to delete the vars/RedHat8.yml file as it is no longer needed with this change.
@gardar thanks for your input. I've edited the file with your solution and removed RedHat8.yml