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
pkg_mgr.py looks in wrong directories for installp and dnf on AIX 7(.2) #83021
Comments
Files identified in the description: None If these files are incorrect, please update the |
@StevePOI |
"ansible-core" 2.14.13 is the newest version available on AIX, see https://www.ibm.com/support/pages/node/883796#A "ansible" has version 7.2.0 |
@ansibot component /opt/freeware/lib/python3.9/site-packages/ansible/module_utils/facts/system/pkg_mgr.py |
this seems like a job for a custom facts module ... |
Lines are identical in latest stable release: https://github.com/ansible/ansible/blob/stable-2.17/lib/ansible/module_utils/facts/system/pkg_mgr.py |
Hello @bcoca ! What do you mean by that? "installp" is AFAIK only used on IBM AIX and the path set by pkg_mgr.py is not correct. Sorry if I don´t understand, this is my first issue here :) . Thanks, With kind regards, Steve |
First, it is not correct 'now' .. I assume it was correct at one point until AIX changed as AIX users had contributed that code and no one had complained in several years. Since we don't have access to AIX to test we count on users keeping this up to date, but this is not really sustainable. One way to address this is having custom/platform specific facts modules, use those via configuration in |
Hello @bcoca !
That could be true, the line with installp and the issue that created it is from 2019, AIX 7.2 is from 2015, never monitored the location of these essentials, just used them since they were in $PATH :)
I understand and would be glad to help with feedback regarding AIX :) .
Do I understand it correctly that this is something planned for Ansible as a whole or do you mean as a "each user has his/her own custom fact modules for their obscure OSes"? Thanks for the information regarding "setup"! With kind regards, Steve |
you CAN have per user facts modules now, it is configurable, but the intent is having 'per platform' and a more divisible facts load. right now you can workaround your issue with just having a facts module that returns the correct pkg_mgr key for ansible_facts, at least until we decide if this is something we need to correct in core (breaking backwards compat?) or if we just push to a facts gathering reorg. |
Summary
Hello!
I was looking why the ansible_pkg_mgr fact was returned as "unknown" on my AIX 7.2 servers, event though I have, additional to the required bos.rte.install *1 (for installp) the DNF environment from the "AIX Toolbox for Linux" *2 installed:
) find /usr -name "installp" -ls 2>/dev/null
) find /opt/freeware/bin -name "dnf*" 2>/dev/null -ls
) lslpp -w /usr/sbin/installp
File Fileset Type
/usr/sbin/installp bos.rte.install File
*1: ) lslpp -L bos.rte.install
Fileset Level State Type Description (Uninstaller)
bos.rte.install 7.2.5.205 CE F LPP Install Commands
) rpm -qa|grep ^dnf
dnf-automatic-4.2.17-32_51.ppc
dnf-plugins-core-4.0.16-32_52.ppc
dnf-data-4.2.17-32_51.ppc
dnf-4.2.17-32_51.ppc
dnf-utils-4.0.16-32_52.ppc
*2: https://www.ibm.com/support/pages/node/6585774
Comparing this to https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/system/pkg_mgr.py :
Line 23:
{'path': '/usr/bin/dnf-3', 'name': 'dnf'},
Line 47:
{'path': '/usr/bin/installp', 'name': 'installp'},
A workaround would be to
ln -s
the paths, but maybe this could be adapted to the "correct" AIX paths?Thanks!
Issue Type
Bug Report
Component Name
pkg_mgr.py
https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/system/pkg_mgr.py#L23
https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/system/pkg_mgr.py#L47
Ansible Version
Configuration
OS / Environment
IBM AIX 7.2 TL 5 SP 7 (7200-05-07-2346)
Steps to Reproduce
Expected Results
"ansible_pkg_mgr": "installp"
# or
"ansible_pkg_mgr": "dnf"
Actual Results
"ansible_pkg_mgr": "unknown"
Code of Conduct
The text was updated successfully, but these errors were encountered: