mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #11475 from nibalizer/cfacter_support
Use cfacter instead of facter if possible
This commit is contained in:
commit
b37be236d9
1 changed files with 5 additions and 1 deletions
|
@ -2841,12 +2841,16 @@ def get_all_facts(module):
|
|||
for (k, v) in facts.items():
|
||||
setup_options["ansible_%s" % k.replace('-', '_')] = v
|
||||
|
||||
# Look for the path to the facter and ohai binary and set
|
||||
# Look for the path to the facter, cfacter, and ohai binaries and set
|
||||
# the variable to that path.
|
||||
|
||||
facter_path = module.get_bin_path('facter')
|
||||
cfacter_path = module.get_bin_path('cfacter')
|
||||
ohai_path = module.get_bin_path('ohai')
|
||||
|
||||
# Prefer to use cfacter if available
|
||||
if cfacter_path is not None:
|
||||
facter_path = cfacter_path
|
||||
# if facter is installed, and we can use --json because
|
||||
# ruby-json is ALSO installed, include facter data in the JSON
|
||||
|
||||
|
|
Loading…
Reference in a new issue