So here is what I want to do I want to run a playbook like this
ansible-playbook playbookX.yml --ask-vault-pass [host or hostgroup]
The playbook should run a local (on the ansible server) python script with parameters
python scriptname.py Parameter1 Parameter2
Parameter1: a secret that should be encrypted and not visible i.e. with ps -aufx and I should get the password from a vault-file. Maybe I should decrypt it in the python script?
Parameter2: The hostname specified in host or hostgroup
(Note: The script should be run for every host when the playbook is run with a hostgroup)
Another note: The python script should best be executed in a virtual_env while the environment should have urllib3 installed.
How could I accomplish that?