gpt4 book ai didi

Ansible 同步模块错误 - 不存在 tty 且未指定 askpass 程序

转载 作者:行者123 更新时间:2023-12-05 07:47:28 26 4
gpt4 key购买 nike

ubuntu 14.04.3 LTS ansible版本:2.1.0,远程服务器上的sshport为44022

我正在使用临时方式以 sudo 用户身份运行同步模块[nopasswd 未启用] 以同步本地和远程目录(推送)

下面是主机文件/etc/ansible/hosts

[webdb]
10.153.99.132
10.153.99.52
[webdb:vars]
ansible_ssh_user=ctuser
ansible_ssh_private_key_file=/root/.ssh/id_rsa
ansible_port=44022

下面是使用的命令:

ansible webdb -s -K  -m synchronize -a "src=/tmp/muhan 
dest=/store" -u ctuser

和(使用的目标端口)

ansible webdb -s -K  -m synchronize -a "dest_port=44022 
src=/tmp/muhan dest=/store" -u ctuser

两个命令都输出以下错误:-

10.153.99.52 | FAILED! => {
"changed": false,
"cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh 'ssh -i /root/.ssh/id_rsa -S none -o StrictHostKeyChecking=no -o Port=44022' --rsync-path=\"sudo rsync\" --out-format='<<CHANGED>>%i %n%L' \"/tmp/muhan\" \"ctuser@10.153.99.52:/store\"",
"failed": true,
"msg": "sudo: unable to resolve host c2.example.com\nsudo: no tty present and no askpass program specified\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.0]\n",
"rc": 12
}
10.153.99.132 | FAILED! => {
"changed": false,
"cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh 'ssh -i /root/.ssh/id_rsa -S none -o StrictHostKeyChecking=no -o Port=44022' --rsync-path=\"sudo rsync\" --out-format='<<CHANGED>>%i %n%L' \"/tmp/muhan\" \"ctuser@10.153.99.132:/store\"",
"failed": true,
"msg": "sudo: unable to resolve host c1.example.com\nsudo: no tty present and no askpass program specified\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.0]\n",
"rc": 12
}

最佳答案

您可以从多个角度解决这个问题:

您需要的确切开关:

ssh_args = -tt

关于Ansible 同步模块错误 - 不存在 tty 且未指定 askpass 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39700335/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com