Are there any modules that user need to interact with command-line interfaces which require user input, for example when we run the command mysql_secure_installation the user need to enter password… and something like that
You can prompt for variables at the start, see the Interactive input: prompts documentation.
1 Like
I think the question is more about how to run commands that prompt for user input. The default tool for these is the ansible.builtin.expect module, which is similar to the expect
command line tool. (You need to install pexpect on the managed node to be able to use ansible.builtin.expect
.)
3 Likes
To be clear, you don’t need to require user input. You can do some sort of lookup to (Ansible Vault / AWS Secrets / some other secure password storage) instead, if you want.