在Jenkins中自动响应Ansible剧本确认

时间:2018-03-02 14:36:03

标签: jenkins ansible

我有一个ansible playbook,需要“yes”或“A”字符串才能继续进行。

如何在管道执行期间自动执行此操作以在Jenkins中提供字符串/确认?

- block:
  - name: Confirm
    pause: prompt="ATTENTION!!
                  \nTHE MACHINES WILL BE MODIFIED.
                  \nAre you sure you want to run this playbook? Answer with 'yes'"
    register: confirm

  - name: Check Confirmation
    fail: msg="Playbook run confirmation failed"
    when: confirm.user_input != "YES" and  confirm.user_input != "yes"

when: "not {{withcheckmode}} and (not unassisted)"

请建议!

-Thanks

0 个答案:

没有答案