jenkins-pipeline - 从 Jenkins 调用 Ansible 时出现问题
问题描述
当我通过 Jenkins 调用 Ansible 时,我在我的剧本中添加了以下脚本
- 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 中粘贴私钥完成了设置)
解决方案
推荐阅读
- python - 如何在字段上定义带有类型提示的 Python 类
- flutter - Image.network 或 NetworkImage 中的图像故障
- eclipse - eclipse为什么在编辑文件之前java文件中的某些代码有背景色
- javascript - 用于获取数据的 mongodb api
- java - 在许多片段中使用 BroadcastReceiver
- python - 为什么 Python int 有一个 __round__ 方法?
- c# - 在 C# 中,如何允许用户根据各自的角色使用不同的方法?
- c# - 如何使用服务帐户 ID 访问我的帐户电子邮件?
- c# - 在 .NET Core MVC 中的控制器之间传输数据
- python - 在两台不同的计算机上用 python 中的种子生成相同的“随机数”