Ansible - 等待用户为远程机器上的交互式脚本键入值 [英] Ansible - wait for user to key in value for interactive scripts on remote machine
问题描述
我希望 ansible 等待我在命令行中的输入,以便在远程机器上运行交互式脚本.期望"不符合我的要求,因为互动问题不断变化.
I would like the ansible to wait for my input in the command line for interactive script running in remote machine. "Expect" will not suite my requirement as the interactive questions keep changing.
例如xxx.pl这必须是运行服务的用户.[root:root]': y ----> 我应该被允许实时更改处理公用事业?[/usr/bin]: y ---> 与此相同
eg xxx.pl This must be the user which is running service. [root:root]': y ----> i should be allowed to change in realtime handling utilities? [/usr/bin]: y ---> same with this
推荐答案
Ansible 无法做到这一点.
This is not possible with Ansible.
Ansible 在将所有任务脚本/参数发送到远程主机以执行之前打包所有任务脚本/参数,并且无法(从 Ansible 2.4 开始)在任务执行期间获得任何反馈——只有任务的最终结果.
Ansible packs all task scripts/parameters before sending it for execution to remote host and there is no way (as of Ansible 2.4) to get any feedback during task execution – only final result of task.
这篇关于Ansible - 等待用户为远程机器上的交互式脚本键入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!