community.general/lib/ansible/module_utils/facts
Anatoly Pugachev fe8412128b facts: solaris: introduce distribution_major version detection for Solaris (#43978)
* facts: solaris: introduce distribution_major version detection for Solaris

Currently, there's no distribution_major in facts module on Solaris OS.
Use "uname -r" output to report major version.

Before the patch we get this on Solaris 11.3 :

$ ansible -o solaris11 -m setup -a filter=ansible_distribution_major_version
solaris11 | SUCCESS => {"ansible_facts": {}, "changed": false}

and after this patch, output is the following:

$ ansible -o solaris11 -m setup -a filter=ansible_distribution_major_version
solaris11 | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "11"}, "changed": false}

Tested with Solaris 11.3 and Solaris 10 (both are x86_64 VMs)

Includes patch for test/units.

Fixes #18197

* Try to fix test unit

* should work now...

* fixes for W291 (trailing whitespace) and E265 (block comment)

* mock uname_release for solaris 10 and solaris 11

* facts: solaris: introduce distribution_major version detection for Solaris

Currently, there's no distribution_major in facts module on Solaris OS.
Use "uname -r" output to report major version.

Before the patch we get this on Solaris 11.3 :

$ ansible -o solaris11 -m setup -a filter=ansible_distribution_major_version
solaris11 | SUCCESS => {"ansible_facts": {}, "changed": false}

and after this patch, output is the following:

$ ansible -o solaris11 -m setup -a filter=ansible_distribution_major_version
solaris11 | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "11"}, "changed": false}

Tested with Solaris 11.3 and Solaris 10 (both are x86_64 VMs)

Includes patch for test/units.

Fixes #18197

* Try to fix test unit

* should work now...

* fixes for W291 (trailing whitespace) and E265 (block comment)

* mock uname_release for solaris 10 and solaris 11

* typo uname_v -> uname_r

* rebase

* fix pep8 E302: 2 blank lines

* remove int() cast to match test case

* use single function for uname_r and uname_v

* add solaris 11.4 OS to distribution test unit

* fix pep8 sanity - E231 missing whitespace

* distribution_major_version variable strip newline

* mocker test function for mock_get_uname with parameters instead of two different functions

* failed to make one fuction with test unit, revert to use 2 different functions

* try to use single get_uname function

* fix pep8: E703
2019-01-23 20:33:32 -05:00
..
hardware parallelize getting mount info (#49398) 2019-01-23 12:33:59 -05:00
network facts: detect IP addresses on busybox properly (#51131) 2019-01-23 22:24:29 +01:00
other
system facts: solaris: introduce distribution_major version detection for Solaris (#43978) 2019-01-23 20:33:32 -05:00
virtual facts: set virtualization_role for KVM hosts (#50770) 2019-01-17 09:47:16 +01:00
__init__.py Relicense fact code I wrote to 2 clause BSD 2017-10-19 10:38:39 -07:00
ansible_collector.py Fix fact deps when 'filter=ansible_fact' is used. (#33441) 2018-01-20 15:07:27 -05:00
collector.py Fact collector ordering deps (#31362) 2018-01-22 18:23:40 -05:00
compat.py Add fact to obtain iSCSI initiator IQN 2018-03-13 17:39:53 -07:00
default_collectors.py Add fact to obtain iSCSI initiator IQN 2018-03-13 17:39:53 -07:00
namespace.py Relicense fact code I wrote to 2 clause BSD 2017-10-19 10:38:39 -07:00
sysctl.py Fix invalid string escape sequences. 2017-11-21 10:03:34 -08:00
timeout.py Make the timeout decorator raise an exception out of the function's scope (#49921) 2018-12-18 18:01:46 -08:00
utils.py made missing cli tools non fatal (#37194) 2018-04-10 17:23:29 -04:00