-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Python shebang #49
Comments
I would like to leave it here for your information only: https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/shebang.html " Some exceptions are permitted. Ask if you have questions. |
I read links you provided in full. Your take from the links you posted is that python shebang should be completely removed from ansible modules (as in the title of this bug)? My understanding is different and more close to the statement from sanity documentation that ansible python modules should always use '#!/usr/bin/python' as shebang. I would appreciate if you can elaborate on your understanding and implications you see for an ansible collection from the links you posted. |
@kksat Already tested Hence provided the Ansible built-in modules as proof of the removal. Removing shebang has no functional impact on the Ansible Module, but does solve problems where the target (or localhost etc) that is executing the Ansible Module (Python file) is required to use a specific interpreter / venv. Otherwise it will always attempt to use the System Python, which may be locked to a much older version and the end-user (best practice) does not wish to install additional Python Packages to the System Python; for stability and security reasons. |
Summary
Remove Python shebang from all Ansible Modules, which cause errors with Python venv
edit: when using Ansible Core 2.17+
:https://github.com/search?q=repo%3Asap-linuxlab%2Fcommunity.sap_libs%20%23!&type=code
See Ansible Core built-in modules for proof (shebang only exists on
hostname
Ansible Module):https://github.com/search?q=repo%3Aansible%2Fansible+path%3A%2F%5Elib%5C%2Fansible%5C%2Fmodules%5C%2F%2F+%23%21&type=code
Issue Type
Bug Report
Component Name
python
Ansible Version
N/A
community.sap_libs Version
All
Configuration
N/A
OS / Environment
No response
Steps to Reproduce
N/A
Expected Results
N/A
Actual Results
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: