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))