当我通过Jenkins调用Ansible时,我已在Playbook中添加了以下脚本
- name: HELLO WORLD PLAY
hosts: webserver
become: yes
become_method: sudo
tasks:
- debug:
msg: "HELLO......."
- shell: echo "HELLO WORLD"
构建作业时出现错误
TASK [setup] *******************************************************************
fatal: [10.142.0.13]: UNREACHABLE! =>
{
"changed": false,
"msg": "ERROR! SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue",
"unreachable": true
}
当我通过CLI运行此剧本时,它将成功运行 但是我无法遍历Jenkins,因为(我已经通过在Jenkins中粘贴私钥来完成设置)