title: Ansible Local Python Script with Parameters
body: <p>So here is what I want to do I want to run a playbook like this</p>
  
  <pre><code>ansible-playbook playbookX.yml --ask-vault-pass [host or hostgroup]
  </code></pre>
  
  <p>The playbook should run a local (on the ansible server) python script with parameters</p>
  
  <pre><code>python scriptname.py Parameter1 Parameter2
  </code></pre>
  
  <p><code>Parameter1</code>: 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?</p>
  
  <p><code>Parameter2</code>: The hostname specified in host or hostgroup
  (Note: The script should be run for every host when the playbook is run with a hostgroup)</p>
  
  <p>Another note: The python script should best be executed in a virtual_env while the environment should have urllib3 installed.</p>
  
  <p>How could I accomplish that?</p>