0

I am using Ansible to run a python script with parameters. One of these parameters are a user password

script: "{{ path_to_setup_py }} --username {{ username }} --password {{ password }} --ip {{ ip }} --hostname {{ hostname }}"

This is able to pull everything but the password, the password is a user input that is then encrypted.

name: password
prompt: Enter your password
private: yes
encrypt: sha512_crypt
confirm: yes
salt_size: 7

When the python script is ran, the password comes up as the hash value and doesn't use the actual password. How would I get this to decrypt the hash and then run it on the script?

Any help would be appreciated, I am a beginner.

1 Answer 1

1

As the fine manual says, using encrypt: is really a specialization for when you are going to just send that value down into the user: module, and not interact with it further.

If you merely want the password to not echo to the screen, that is what the private: yes controls

In short, unless you have a requirement that you didn't disclose in your question, the solution is to just remove the encrypt: and salt_size: parameters:

  name: password
  prompt: Enter your password
  private: yes
  confirm: yes
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.