I am trying to retrieve the version number of the installed executable. The complete path exists, the file has executable permissions, but I am encountering a 127 error, indicating that the file does not exist. Have I missed something? Here is the code that I have:
The error that I am getting:
fatal: [xxx.yyy.zzz.fff]: FAILED! => {“msg”: “An unhandled exception occurred while running the lookup plugin ‘ansible.builtin.pipe’. Error was a <class ‘ansible.errors.AnsibleError’>, original message: lookup_plugin.pipe(/home/BreadPitt/program/executable --version) returned 127. lookup_plugin.pipe( /home/BreadPitt/program/executable --version) returned 127”}
My guess is that pipe is trying to run an executable named exactly this: “/home/BreadPitt/program/executable --version” vs passing the --version option to the executable.
You don’t, you use the command or shell modules, and register the result, potentially manipulating the result into the shape you want with a subsequent set_fact task.