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

Changes to linux.py for setup module to return more relevant information for s390 #83140

Closed
1 task done
agilleyrh opened this issue Apr 24, 2024 · 2 comments · Fixed by #83157
Closed
1 task done

Changes to linux.py for setup module to return more relevant information for s390 #83140

agilleyrh opened this issue Apr 24, 2024 · 2 comments · Fixed by #83157
Labels
bug This issue/PR relates to a bug. has_pr This issue has an associated PR. jira Associated with a Jira module This issue/PR relates to a module.

Comments

@agilleyrh
Copy link

agilleyrh commented Apr 24, 2024

Summary

On S390 systems, gather_facts return "NA" due to not have /proc/sys entries and dmidecode not being available.

I did not have permission to do a pull request but below is a snippet that might get this in the right direction, I am not a python person so this will likely need some refinement.

linux.py.txt

Add the following after line 407:

            else:
                # Open the /proc/cpuinfo file
                with open('/proc/cpuinfo', 'r') as file:
                    # Read the content of the file
                    content = file.readlines()
                    # Search for "S390" in each line
                    for line in content:
                        if "S390" in line:
                            found_s390 = True
                            break
                # Register "IBM/S390" as 'system_vendor' if found
                if found_s390:
                    system_vendor = "IBM/S390"

AAP-21347

Issue Type

Bug Report

Component Name

setup module

Ansible Version

$ ansible --version


all

Configuration

default configuration

OS / Environment

IBM/S390, Any version of RHEL

Steps to Reproduce

just logging into a S390 system you can see dmidecode is not availalbe and /proc/sys/ entries are not there

Expected Results

to gather facts from other files that are present on S390 systems.

Actual Results

the facts return "NA"

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. module This issue/PR relates to a module. labels Apr 24, 2024
@ansibot
Copy link
Contributor

ansibot commented Apr 24, 2024

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the component bot command.

@sivel
Copy link
Member

sivel commented Apr 24, 2024

I'm also looking at /proc/sysinfo:

sysinfo...

Manufacturer:         IBM
Type:                 8561
LIC Identifier:       xxxxxxx
Model:                400              LT1
Sequence Code:        00000000000xxxxx

See also:

To clarify Manufacturer would be used as system_vendor, Type for product_version, Sequence Code as product_serial with leading 0s stripped. This doesn't cover product_name however, which is usually an friendly name for product_version, so maybe we just duplicate.

@sivel sivel added the jira Associated with a Jira label Apr 24, 2024
@mattclay mattclay removed the needs_triage Needs a first human triage before being processed. label Apr 25, 2024
sivel added a commit to sivel/ansible that referenced this issue Apr 29, 2024
@ansibot ansibot added the has_pr This issue has an associated PR. label Apr 29, 2024
sivel added a commit to sivel/ansible that referenced this issue Apr 29, 2024
sivel added a commit to sivel/ansible that referenced this issue Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug. has_pr This issue has an associated PR. jira Associated with a Jira module This issue/PR relates to a module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants