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

Add ipaclient support for Amazon Linux 2 #828

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Drugantibus
Copy link

@Drugantibus Drugantibus commented May 12, 2022

Amazon Linux 2 is a RedHat-7 based distro, but reports its major version as '2'. This varfiles allows installation of the correct packages and enrollment using the ipaclient role.

@t-woerner
Copy link
Member

t-woerner commented May 12, 2022

The vars file for Ansible Linux 2 should not be named RedHat-2,yml. Please create a link for Ansible-2.yml pointing to RedHat-7.yml instead. Why have you set ansible_python_interpreter? Is that really needed?

@Drugantibus
Copy link
Author

Yes, unfortunately AL2 doesn't provide the ipapython python3 module in its repos. Updated the filename to the more proper name

@t-woerner
Copy link
Member

RHEL-7 is also not providing the Python 3 IPA bindings. Only Python 2 bindings for IPA are there.

@rjeffman
Copy link
Member

Why not only create a link from RedHat-7.yml to Amazon-2.yml?

This worked for me.

@Drugantibus
Copy link
Author

I'll be honest, I don't understand how it's supposed to work without switching to python2 if the python3 module is not available. Since the python3 module is not available in AL2's repos and the role installs the modules using yum rather than pip this role cannot work unless it's running in python2, can it?. If I remove the ansible_python_interpreter line or link it to RHEL-7.yml, it fails with ModuleNotFoundError: No module named 'ipapython', as expected. @rjeffman, did you test on a clean AL2 installation?

I would also prefer to abandon python2 for good, but I haven't been able to get this role to run in python3 on a fresh, up to date AL2 installation even with manual intervention.

@t-woerner
Copy link
Member

Ansible should automatically use Python2 for all RHEL-7 based distributions. If this is not the case for Amazon Linux 2, then we really need that extra line and file.

@Drugantibus
Copy link
Author

Indeed, the Ansible python interpreter discovery uses /usr/bin/python3.7 on Amazon Linux 2.

# Provides support for RedHat-7 based Amazon Linux 2

ipaclient_packages: [ "ipa-client", "libselinux-python" ]
# The 'ipapython' module is not available in python3.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be changed to something like in your last comment to point out why this is not the same as in RHEL-7.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@rjeffman
Copy link
Member

@Drugantibus yes, I tested on a clean AL2 installation. What I did was:

  • download AL2 cloud image
  • configure IP address to static (due to my environment)
  • dnf updated the distro
  • deployed ipaclient

I ran it locally, with KVM/libvirt, not on Amazon cloud.

Copy link
Member

@t-woerner t-woerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@t-woerner
Copy link
Member

Please create one patch for this 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

Successfully merging this pull request may close these issues.

3 participants