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

Populate product_name and system_vendor facts on Solaris #44114

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@mavit
Contributor

mavit commented Aug 14, 2018

SUMMARY

The first line of prtdiag on Solaris mentions the manufacturer and model name of the hardware. Unfortunately, these two fields are not reliably delineated, so some guesswork is required.

The existing code assumes that the model name consists of three words, with the middle word being "Enterprise". Whilst this is often true for recent Oracle hardware, it isn't true for a lot of other equipment that's still out there. By using a hard-coded list of known manufacturers, we can make a better attempt at separating the two parts.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

Hardware facts.

ANSIBLE VERSION
ansible 2.7.0.dev0 (solaris-system-vendor 12a36255d7) last updated 2018/08/14 10:03:25 (GMT +100)
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/username/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/username/src/ansible/lib/ansible
  executable location = /home/username/src/ansible/bin/ansible
  python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
ADDITIONAL INFORMATION

Before:

$ ansible -m setup sparc-server | egrep 'system_vendor|product_name'
<no output>

After:

$ ansible -m setup sparc-server | egrep 'system_vendor|product_name'
        "ansible_product_name": "Sun Fire V120 (UltraSPARC-IIe 648MHz)", 
        "ansible_system_vendor": "Sun Microsystems", 
@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 14, 2018

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/module_utils/facts/hardware/sunos.py:187:41: unnecessary-lambda Lambda may not be necessary

click here for bot help

@webknjaz webknjaz removed the needs_triage label Aug 14, 2018

@webknjaz webknjaz requested a review from alikins Aug 14, 2018

Peter Oliver added some commits Aug 15, 2018

@ansibot ansibot removed the needs_revision label Aug 15, 2018

@mator

This comment has been minimized.

Contributor

mator commented Aug 20, 2018

Tested with solaris 10 and solaris 11 under vmware.
Before changes

$ ansible solaris11 -m setup | egrep 'system_vendor|product_name'
<no output>
$ ansible -o solaris11 -m setup -a filter='ansible_system_vendor'
solaris11 | SUCCESS => {"ansible_facts": {}, "changed": false}

after patch(es) applied:

$ ansible solaris11 -m setup | egrep 'system_vendor|product_name' 
        "ansible_product_name": "VMware Virtual Platform", 
        "ansible_system_vendor": "VMware, Inc.", 
@mator

This comment has been minimized.

Contributor

mator commented Nov 1, 2018

@mavit can you rebase to latest ansible git version - https://docs.ansible.com/ansible/latest/dev_guide/developing_rebasing.html

@alikins can you please apply this pull request?! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment