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

Populate product_name and system_vendor facts on Solaris #44114

Merged
merged 3 commits into from
Jan 23, 2019

Conversation

mavit
Copy link
Contributor

@mavit 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 ansibot added affects_2.7 This issue/PR affects Ansible v2.7 feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Aug 14, 2018
@ansibot

This comment has been minimized.

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Aug 14, 2018
@webknjaz webknjaz removed the needs_triage Needs a first human triage before being processed. label Aug 14, 2018
@webknjaz webknjaz requested a review from alikins August 14, 2018 13:18
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Aug 15, 2018
@mator
Copy link
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.", 

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 29, 2018
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Sep 22, 2018
@ansibot ansibot removed the support:core This issue/PR relates to code supported by the Ansible Engineering Team. label Oct 16, 2018
@ansibot ansibot added the community_review In order to be merged, this PR must follow the community review workflow. label Oct 24, 2018
@mator
Copy link
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!

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Nov 25, 2018
@dagwieers dagwieers added the solaris Solaris community label Jan 9, 2019
Copy link
Contributor

@dagwieers dagwieers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, may need to be backported to v2.7 too.

@dagwieers dagwieers requested a review from bcoca January 23, 2019 01:26
@ansibot
Copy link
Contributor

ansibot commented Jan 23, 2019

@ansibot ansibot added cloud storage zfs ZFS community labels Jan 23, 2019
@dagwieers dagwieers merged commit 9edeb19 into ansible:devel Jan 23, 2019
@dagwieers
Copy link
Contributor

@ansible ansible locked and limited conversation to collaborators Jul 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 cloud core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. solaris Solaris community stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. storage support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. zfs ZFS community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants