Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version no longer works on Fedora 36 (note: I am aware this is not a supported distro) #57

Open
benblasco opened this issue May 30, 2022 · 6 comments

Comments

@benblasco
Copy link

The latest version of the role can no longer be deployed on Fedora hosts because of changes to the role intended to support RHEL/CentOS 7 and 8. Running the role fails because the distribution_major_version variable lookup now fails.

I can see under the vars/RedHat.yml directory there are some variables that are set differently based on whether it's RHEL/CentOS 7 or 8, and this breaks installs for Fedora hosts, which are also in the RHEL family. Please note that I was able to work around the issue by adding the following to the playbook that calls the role:

   - name: Override the OS version so the role works
     set_fact:
       ansible_facts:
         os_family: RedHat
         distribution: RedHat
         distribution_major_version: 8
         distribution_version: 8
         python:
           version:
             major: 3

However the above totally clobbers the entire ansible_facts dictionary, which may have some as yet unforeseen effects. I am currently looking to find whether I can edit individual variables without overriding the rest of the dictionary.

If anybody is interested in this use case please let me know. The role otherwise works extremely well on Fedora hosts and I am very grateful for the effort put into it by the StackHPC team!

I would be happy to possibly contribute to the role to add (limited) support for Fedora hosts if I can just get the role to "pretend" that a Fedora host is a RHEL/CentOS 8 host.

@markgoddard
Copy link
Member

Hi @benblasco, we don't generally use Fedora, but would be happy to accept any reasonable changes to make it work.

@benblasco
Copy link
Author

Hi Mark, Please keep this open as I am working on a more elegant way to introduce (limited) Fedora support.

@benblasco
Copy link
Author

Hi Mark,

I have made a slight change to the solution which I presented above, which avoids clobbering any variables that don't need to be overwritten/overridden. The change is simply to switch to the ansible.utils.update_fact module, as documented here:

ansible.utils.update_fact module – Update currently set facts

Here's my code snippet from the playbook, which I have tested successfully on Fedora 36:

  pre_tasks:
 
   - name: Override the OS version so the role works
     ansible.utils.update_fact:
       updates:
         - path: ansible_facts.os_family
           value: RedHat
         - path: ansible_facts.distribution
           value: RedHat
         - path: ansible_facts.distribution_major_version
           value: 8
         - path: ansible_facts.distribution_version
           value: 8

Do you think there's a suitable location where I could add this information for others to consume? Something similar may also be an easy way to enable some rudimentary RHEL/CentOS Stream/Rocky/Alma 9 support for the role. Happy to contribute if you think it's suitable!

@markgoddard
Copy link
Member

Hi @benblasco, that approach does seem better than the original. Feel free to propose adding this to the end of the README.

@benblasco
Copy link
Author

Will do. Will write it up and send a PR after Sep 12 as I'm currently mostly offline. Thank you for your feedback!

@benblasco
Copy link
Author

Hi @markgoddard Just confirming that it worked for me on Fedora 38 with the changes above. I should probably get onto that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants