无业游民和互动

时间:2019-04-07 15:36:17

标签: ansible vagrant

我正在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]:由于标准输入不是交互式的,因此不等待对提示的响应

配置将继续。

有什么办法解决吗?

1 个答案:

答案 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
相关问题