我正在ansible
中运行vagrant
设置程序。
在某些时候,我需要一些用户输入,如下所示:
- pause:
prompt: "Port 6443 seems in use and / or kubernetes cluster already initialized! Proceed with resetting cluster? (Y/n)"
register: reset_cluster
when: some_condition
但是,输出如下:
[WARNING]:由于标准输入不是交互式的,因此不等待对提示的响应
配置将继续。
有什么办法解决吗?
答案 0 :(得分:0)
Ansible prompts docs. Maybe you could do: And then in your code:
vars_prompt:
- name: "reset_cluster"
prompt: "If so and so is already initialized would you like to reset?"
default: "Y"
private: no