summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer Krum <nibz@spencerkrum.com>2015-07-02 15:41:12 -0700
committerSpencer Krum <nibz@spencerkrum.com>2015-07-04 09:13:20 -0700
commit3887173c2c3a9feb3ed4a67fccc330d5ebe3ff8f (patch)
tree98f59d7f7170067f17ab341d64c119f7f50c901c
parent139138c6049a375acd7cf765b987b8223d19b1b6 (diff)
downloadansible-3887173c2c3a9feb3ed4a67fccc330d5ebe3ff8f.tar.gz
Use cfacter instead of facter if possible
CFacter is the facter replacement written in C++. It is available from the puppetlabs repo.
-rw-r--r--lib/ansible/module_utils/facts.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index aedd028b24..7b95d2e65d 100644
--- a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -2734,12 +2734,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