ansible-valult encrypt_string and adhoc command usage - how to ?

Friends:

I am trying to understand how to do something. I am not even sure it is possible. Try to help me please.

Thank you in advance for your help.

End User types in user id and password on jenkins screen.

I then want to encrypt that password with vault and write that to a file say /tmp/coolCucumber.yml (coolCucumbers encrypted password)

This way I can use that encrypted file at other places I need it.

I later on want to use the ansible adhoc command like this

ansible all -i “preditserver.ntd.bip.com” -m shell -a “ls -ltr” --extra-vars=“ansible_password=${coolCucumberPassword}” --vault-password-file=/tmp/vault

Will this work ?

-N

Any help or pointers is appreciated.