S
S
Sanes2016-03-14 16:51:37
System administration
Sanes, 2016-03-14 16:51:37

Ansible. Correct password generation?

Can you please tell me how you generate passwords in Ansible?

  1. The shell module: makepasswd seems to fit, but can't be placed in handlers.
  2. Lookups generates a password in a single instance with a given parameter.

I have notify on apt mysql-server and if MySQL is installed, then I need to call handler
command: 'mysqladmin -u root password {{mysqlpass}}'

I would like to generate {{ mysqlpass }} or, as an option, place it in vars_prompt, but vars_prompt, as I understand it, cannot be placed in the handler and it will be called anyway.
Maybe my algorithm of actions is not correct?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-03-14
Protko @Fesor

passwords are generated, placed in inventory or host_vars and stored in encrypted form (for example, using ansible vault). Generating them while provisioning the machine is not a good idea, although it is sometimes convenient.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question