From fb471fc0a84007e591346c9e9f7e5e8e470a741c Mon Sep 17 00:00:00 2001 From: Ton Kersten Date: Fri, 19 Feb 2016 10:43:55 +0100 Subject: [PATCH] Fix facter path --- lib/ansible/modules/extras/system/facter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/system/facter.py b/lib/ansible/modules/extras/system/facter.py index a491283544..bb8553d0a2 100644 --- a/lib/ansible/modules/extras/system/facter.py +++ b/lib/ansible/modules/extras/system/facter.py @@ -45,7 +45,10 @@ def main(): argument_spec = dict() ) - cmd = ["/usr/bin/env", "facter", "--puppet", "--json"] + facter_path = module.get_bin_path('facter', opt_dirs=['/opt/puppetlabs/bin']) + + cmd = [facter_path, "--puppet", "--json"] + rc, out, err = module.run_command(cmd, check_rc=True) module.exit_json(**json.loads(out))