【问题标题】:getting MODULE FAILURE error with pipelining = True in ansible在 ansible 中使用流水线获取 MODULE FAILURE 错误 = True
【发布时间】:2016-10-26 11:42:04
【问题描述】:

运行我的 Ansible playbook 时出现以下错误:

{"changed": false, "failed": true, "invocation": {"module_name": "setup"}, "module_stderr": "sudo: 抱歉,你必须有一个 tty 才能运行 sudo\n" , "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}

我的ansible.cfg 中有 ssh 流水线 = True,如果我创建它false,错误消息就会消失。

我在 CentOS 7 机器上尝试这个,我的 Ansible 版本是 2.1.1.0。有什么办法可以在不关闭 ssh 管道的情况下摆脱上述错误?

【问题讨论】:

    标签: ansible ansible-playbook


    【解决方案1】:

    在我的剧本中使用这些更改:

       vars:
        ansible_ssh_pipelining: no
       tasks:
        - name: Disable require tty access in /etc/sudoers
          replace: dest="/etc/sudoers"
                   regexp='^Defaults    requiretty'
                   replace='Defaults    !requiretty'
    

    【讨论】:

      猜你喜欢
      • 2017-09-26
      • 1970-01-01
      • 2020-06-19
      • 2016-11-10
      • 2017-09-12
      • 2017-11-29
      • 1970-01-01
      • 1970-01-01
      • 2012-09-01
      相关资源
      最近更新 更多