ansible handling stdin input

Hi

Hopefully someone has encountered and resolved this issue.

supposedly my playbook:
- main: execute script
shell: “/home/settingip”

when executing the program, it will run and require stdin/keyboard input, such as IP, hostname, etc.

can i pre-fill this in ansible ? knowing that the prompt will have the same question everytime the command runs

Thank you!

Have a look at the expect module:

https://docs.ansible.com/ansible/latest/modules/expect_module.html

Richard

thanks Richard!