-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
hostname module cannot be used on platform Linux (Red hat enterprise linux) #31811
Comments
The error the user gets is: "hostname module cannot be used on platform Linux (Red hat enterprise linux)" This is interesting. Looking at the code I can not figure out how that string is getting constructed. The error message we are seeing is from hostname.py line 89: Older releases of Ansible have slightly different line numbers, but the same strings. I am unable to find a full string in this repository like this "Red hat enterprise linux" with this lower case "h" and ending in "linux". None of the strings in the /etc/*release files on this 7.5 system have the lower case "h" either, so I don't think Ansible is pulling the string from an etc release file. |
@mbruzek The 'Red hat enterprise linux' is likely coming from module_utils.basic.get_distribution (https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/basic.py#L262). It does a .capitalize() on the distro name. |
I was unable to test the original branch (because it was deleted) but I tested ansible:devel and did not get the same hostname issue. I believe this fix resolved the issue. |
ISSUE TYPE
COMPONENT NAME
hostname
ANSIBLE VERSION
I tried with Ansible 2.3.2 and 2.4.0.0 both versions failed to set the hostname on a RHEL 7.5 system.
CONFIGURATION
inventory
OS / ENVIRONMENT
Running Ansible from RHEL 7.4 server
Controlling a RHEL 7.5 system.
SUMMARY
The hostname module does not work on RHEL version 7.5. This is the version of RHEL that we get when `yum update' is run.
STEPS TO REPRODUCE
yum update
commandcat /etc/*release
EXPECTED RESULTS
I expected the hostname module to work with every release of RHEL.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: