Comments (5)
Thanks @aueam for your contribution,
The shebang is a requirement of Ansible and how Ansible work, the shebang in modules is not useless, even though they are not executable (and were nevert meant to be executable as is).
Ansible does some magic packaging before they get transferred to the target and executed, including some module utils which you see in the modules. (AFAIR the shebang will be replaced to whatever ansible_python_interpreter points to)
Read more about the requirement https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html#python-shebang-utf-8-coding
from ansible-collection-vultr.
Interesting, @resmo. I believe the ansible_python_interpreter
logic simply replaces the #!/usr/bin/python
shebang by whatever is Python on the target machine (for example #!/usr/bin/python3
) and then the particular file is executed (if it is meant to be executed). In this particular case I believe these files are not executed, but instead imported as Python modules.
OTOH, it is easily possible that I'm wrong here, so please could you show us what ansible
does (or could do) with those files to make them executable by utilizing their shebang?
Thank you.
from ansible-collection-vultr.
In addition, for the plugins/inventory/vultr.py
file the current shebang does not follow the rule you are referring to :-).
from ansible-collection-vultr.
indeed, ironically there shouldn't be a shebang in an inventory plugin because it's executed on the controller.
from ansible-collection-vultr.
I found this: https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/shebang.html
So it looks like ansible really requires shebang in modules even they are not executable.
I think this bug report could be closed.
from ansible-collection-vultr.
Related Issues (20)
- [Feature] - Object Storage HOT 1
- [BUG] - Wrong name-label alias in instance_info module
- [Feature] - Container Registry support
- [BUG] - traceback in CI tests
- [Missing] - VPC 2.0 parameter HOT 1
- [BUG] - instance absent fails with "Server is currently locked"
- Consider using true/false for all booleans in docs
- [Feature] State `reinstalled` HOT 1
- [Bug] vultr_tags not returned in inventory HOT 4
- [Feature] - Ability to Reboot Instance(s) HOT 1
- Typo in `instance_info` examples
- [BUG] - Idempotence check fails in vultr.cloud.firewall_rule when ICMP has port HOT 3
- [Feature] - bare metal support HOT 2
- [BUG] - Weird 401 error
- [BUG] - internal_ip no longer shows up with ansible-inventory --list HOT 6
- [Feature] - vultr_gateway_v4 not set in hostvars; gateway_v4 appears in vultr.cloud.instance_info HOT 4
- [BUG] - module "reserved_ip" crashes when adding new reserved IP HOT 2
- [Feature] - automatic private network set up with enable_vpc: true|false HOT 6
- Add "user_schema" as parameter in instance module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-collection-vultr.