I have created a dynamic inventory script and it requires credentials for login and pull the host names.
So what is the best way to pass credentials to dynamic inventory script.
I have seen some docs on ansible doco where passing credentials from .ini file as plain text.
Also i have seen exporting as environment variables.
Can i use something like encryption module in python or are there any best practices.
I have already developed a scirpt. And plugin wont work in our current solution. I do not have plugins from ansible to use.
So i developed a scirpt. Still need a solution to pass credentials to dynamicinventoryscirpt.py
Well, scripts are used via the 'script' plugin, so you are already
using plugins. Scripts are very easy to create, they just need to
output properly formatted JSON, but the problem with scripts, is that
the are externally executed and cannot use facilities (like vault)
that Ansible provides. Inventory plugins are a little harder to
create, but have access to many more features from inside Ansible.