ansible expect模块响应密码提示

时间:2016-06-29 18:42:46

标签: ansible ansible-playbook

我已阅读here

上与文档相关的期望模块

我试图将CentOS7添加到2012 AD域控制器,这是我的剧本,

  - name: Attempt to join the server to AS
    expect:
      command: realm join --user=admin@mydomain.local mydomain.local
      responses:
        (?i)Password for admin@mydomain.local: abc123

Ansible playbook失败,说密码不正确,这是使用expect的正确方法吗?

1 个答案:

答案 0 :(得分:0)

您是否尝试将密码用引号括起来?

(?i)Password for admin@mydomain.local: "abc123"