Commit graph

8 commits

Author SHA1 Message Date
Brian Coca
f9af27c631
dont clobber facts in loop ()
* dont clobber facts in loop

	fixes 
2020-08-04 15:41:42 -04:00
Rick Elrod
d372ce2c5d
Get m_u.facts.utils coverage up to 100% ()
* Get m_u.facts.utils coverage up to 100%

Change:
- Add tests to 'gathering_facts' integration target to get
  module_utils.facts.utils coverage up to 100%.
- This also clears incidental coverage from incidental_selinux.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-13 16:52:56 -07:00
Brian Coca
9281148b62
correctly merge multiple facts results ()
* correctly merge multiple facts results

  fixes 
2020-05-20 18:53:37 -04:00
Brian Coca
a9d2ceafe4
prevent ansible_facts injection ()
- also only replace when needed
 - switched from replace to index
 - added test to verify bogus_facts are not accepted

CVE-2020-10684
2020-03-24 15:46:56 -04:00
Matt Clay
e5094e8071
Cleanup integration test inventory. ()
* Move var_blending test inventory into test.
* Remove Amazon specific inventory entry for tests.
* Remove Azure specific inventory entry for tests.
* Move var_precedence test inventory into test.
* Move unicode test inventory into test.
* Remove unused inventory entry.
* Move gathering_facts test inventory into test.
* Move delegate_to test inventory into test.
* Clean up inventory for binary_modules test.
* Clean up integration test inventory.
2019-01-10 14:45:12 -08:00
Mickaël Guérin
8ac69b0a5f Fix gathering facts in run_once play ()
* Fix gathering facts in run_once play

Fixes https://github.com/ansible/ansible/issues/39312

* Check that run_once doesn't prevent fact gathering
2018-05-04 15:33:32 -04:00
Adrian Likins
6e585bdf24
Fact collector ordering deps ()
Add deps/requires for fact collectors

Fact collectors can now set a required_facts
class attribute that will be a set of the names
of fact collectors they require to be run first.

ie, if a collector needs to know the ansible_distribution,
it should set it's required_facts to include 'distribution'

        required_facts = set(['distribution'])

If a collector requires another collector, it gets added
to the selected collector names.

We then topological sort the ordering of the collectors
so that deps work out (ie, 'distribution' will run before
'service_mgr')

required_facts were added to the collectors for:

        - network (requires 'distribution', 'platform')
        - hardware (requires 'platform')
        - service_mgr (requires 'distribution', 'platform')

Fix name references for facts (need 'ansible_' prefix)
is service_mgr

Fixes 
2018-01-22 18:23:40 -05:00
Matt Clay
80a5c70ad7 Split integration tests out from Makefile. () 2016-10-12 14:57:53 -07:00