当前位置: 首页 > news >正文

使用ansible的连通性检查的关键参数

使用ansible进行ping命令的时候发现有些不通

ansible cba -m ping

10.1.1.1 | FAILED! => {"msg": "Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.  Please add this host's fingerprint to your known_hosts file to manage this host."
}
10.1.1.2 | FAILED! => {"msg": "Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.  Please add this host's fingerprint to your known_hosts file to manage this host."
}
10.1.1.3 | FAILED! => {"msg": "Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.  Please add this host's fingerprint to your known_hosts file to manage this host."
}
10.1.1.4 | SUCCESS => {"changed": false,"ping": "pong"
}

可以通过修改配置文件
vim /etc/ansible/ansible.cfg
host_key_checking = False # 检查对应服务器的host_key,建议取消注释
将注释关掉即可

[root@sc-paas-bs-teledb-66 ansible]# ansible cba -m ping       
10.1.1.1 | SUCCESS => {"changed": false,"ping": "pong"
}
10.1.1.2 | SUCCESS => {"changed": false,"ping": "pong"
}
10.1.1.3 | SUCCESS => {"changed": false,"ping": "pong"
}
10.1.1.4 | SUCCESS => {"changed": false,"ping": "pong"
}

将host_key_checking设置为False表示禁用主机密钥检查。这可能会导致安全问题,因为这样会允许连接到未经验证的主机。建议仅在测试环境中使用此设置,并在生产环境中启用主机密钥检查以确保安全性。

如果不是将此参数打开,则必须进行ssh 过后,才能通过ansible进行连接。

http://www.lryc.cn/news/340196.html

相关文章:

  • Jenkins用maven风格build报错解决过程记录
  • Web3.0与AI的交融:开启智能互联网新时代
  • 自动化_Ansible学习笔记
  • 用于密集视觉冲击的紧凑三维高斯散射Compact 3D Gaussian Splatting For Dense Visual SLAM
  • ChatGPT揭秘:高效论文写作的秘籍
  • 电脑不能上网,宽带调制解调器出现问题如何处理
  • 云计算: OVN 集群 部署分布式交换机
  • electron+Vue3构建桌面应用之IPC通讯
  • html球体涨水
  • ubuntu手动编译opencv 4.9.0遇到的问题汇总
  • SEO之搜索引擎的工作原理(三)
  • 开发语言漫谈-python
  • JVM指令收集
  • 小程序解析二维码:jsQR
  • 【verilog 设计】 reg有没有必要全部赋初值?
  • NLP问答系统:使用 Deepset SQUAD 和 SQuAD v2 度量评估
  • php开发中如何防止抓包工具伪造请求
  • 密码学 | 椭圆曲线数字签名方法 ECDSA(下)
  • 拟态个人主页UI源码
  • 移动硬盘无法打开?别慌!这里有救星!
  • windows下已经创建好了虚拟环境,但是切换不了的解决方法
  • Java反序列化基础-类的动态加载
  • 课堂行为动作识别数据集
  • 【数据库】MVCC
  • 快速排序题目SelectK问题
  • es6解构赋值
  • Jenkins上面使用pnpm打包
  • 设计编程网站集:动物,昆虫,蚂蚁养殖笔记
  • 面经学习(众智宏图实习)
  • DataGrip2024安装包(亲测可用)