diff options
author | Brian Coca <bcoca@ansible.com> | 2015-07-29 22:46:21 -0400 |
---|---|---|
committer | Brian Coca <bcoca@ansible.com> | 2015-07-29 22:46:21 -0400 |
commit | b37be236d91efd06da56ae80f692c8599b72b255 (patch) | |
tree | 17d2e9fd07e9d567b4126081930fa1e1a0d9b06d | |
parent | 769b0d92ee0eb548ae5f16fdaf54a7804fd08caf (diff) | |
parent | 3887173c2c3a9feb3ed4a67fccc330d5ebe3ff8f (diff) | |
download | ansible-b37be236d91efd06da56ae80f692c8599b72b255.tar.gz |
Merge pull request #11475 from nibalizer/cfacter_support
Use cfacter instead of facter if possible
-rw-r--r-- | lib/ansible/module_utils/facts.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 12186610b7..a3f8c05d65 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -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 |