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

wants to merge 3 commits into
base: devel


None yet
4 participants

mavit commented Aug 14, 2018


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.

  • Feature Pull Request

Hardware facts.

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)]


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


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

This comment has been minimized.


ansibot commented Aug 14, 2018

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

lib/ansible/module_utils/facts/hardware/ 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


This comment has been minimized.


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.", 

This comment has been minimized.


mator commented Nov 1, 2018

@mavit can you rebase to latest ansible git version -

@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