ansible报错处理
[root@localhost ~]# ansible testhosts -m command -a 'rm -rf /tmp/haha'
[WARNING]: Consider using the file module with state=absent rather than running 'rm'. If you need to use command
because file is insufficient you can add 'warn: false' to this command task or set 'command_warnings=False' in
ansible.cfg to get rid of this message. #vim /etc/ansible/ansible.cfg
command_warnings=False去掉#,注意要顶格
[root@localhost ~]# ansible-playbook test.yaml
[WARNING]: * Failed to parse /etc/ansible/hosts with yaml plugin: Syntax Error while loading YAML. did not find
expected <document start> The error appears to have been in '/etc/ansible/hosts': line 45, column 1, but may be
elsewhere in the file depending on the exact syntax problem. The offending line appears to be: [testhosts]
192.168.42.9 ansible_ssh_user=root ansible_ssh_port=22 ansible_ssh_pass=0330 port-100 ^ here [WARNING]: * Failed to parse /etc/ansible/hosts with ini plugin: /etc/ansible/hosts:45: Expected key=value host
variable assignment, got: port-100 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match
'all' #配置文件出错,检查书写是否有问题
[root@localhost ~]# ansible testhosts -m ping
192.168.42.8 | 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."
}
192.168.42.9 | 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."
}
192.168.42.10 | 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."
}
碰到这种问题就 vim /etc/ansible/ansible.cfg做如下修改(去掉#)
ansible报错处理的更多相关文章
- ansible报错Aborting, target uses selinux but python bindings (libselinux-python) aren't installed【转】
报错内容: TASK [activemq : jvm configuration] ********************************************************** ...
- ansible报错AttributeError: module 'urllib.request' has no attribute 'HTTPSHandler'
报错内容: TASK [activemq : extract activemq tarball] *************************************************** ...
- ansible报错Aborting, target uses selinux but python bindings (libselinux-python) aren't installed
报错内容: TASK [activemq : jvm configuration] ********************************************************** ...
- ansible报错Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this
安装和配置好ansible,执行命令时报错如下 [root@test01 ansible-install]# ansible test -m shell -a 'w' >> Using a ...
- ansible报错:Failed to connect to the host via ssh: Permission denied
原因: 没有在ansible管理节点(即安装ansible的节点)上添加目标节点(即需要管理的节点)的ssh认证信息. 解决办法: 1.在管理节点生成公钥 ssh-keygen 路径为:~/.ssh/ ...
- 关于PyYAML报错问题解决
转自:http://www.fwqtg.net/%E5%85%B3%E4%BA%8Epyyaml%E6%8A%A5%E9%94%99%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86% ...
- Ansible 脚本运行一次后,再次运行时出现报错情况,原因:ansible script 的格式不对,应改成Unix编码
Ansible 脚本运行一次后,再次运行时出现报错情况,原因:ansible script 的格式不对,应改成Unix编码 find . -name "*" | xargs do ...
- ansible执行shell模块和command模块报错| FAILED | rc=127 >> /bin/sh: lsof: command not found和| rc=2 >> [Errno 2] No such file or directory
命令: ansible -i hosts_20 st -m shell -a 'service zabbix_agentd star' -K --become ansible -i hosts_2 ...
- Ansible 连接主机显示报错的处理方案
一.在ansible安装完毕后一般需要以SSH的方式连接到需要进行管理的目标主机,一开始遇到了如下问题: 192.168.15.4 | UNREACHABLE! => { "ch ...
随机推荐
- 3.Https服务器的配置
1.前言: 所谓区块链,简而言之就是一种数据结构,每一个区块都像账本的每一页纸记录了该网络上的交易信息,而众多区块在时间的基础上按照顺序连接起 来就形成了区块链.区块链能够以数字方式识别和跟踪交易,并 ...
- Centos下安装compoer, 解决vendor目录问题
laravel部署时使用git拉代码的话,vendor目录部署是没有提交到git上的,如果没有该目录,服务会报错如下 Warning: require(/opt/soft/pro/bootstrap/ ...
- Linux命令行——scp命令
原创声明:本文系博主原创文章,转载或引用请注明出处. scp 一般格式: scp [option] src dst 1. src和dst格式为: [user@]host:/path/to/file ...
- golang gin框架 集成swagger 自动生成文档
goswagger github仓库 https://github.com/swaggo/swag 安装 swag cli 1.因为网络原因,先安装gopm 管理工具 go get -v -u git ...
- 使用jmeter发送put请求的三种方式
之前在前公司使用jmeter调试接口时,由于都是get和post请求,所以一直是顺风顺水的,毫无阻拦在短时间内调试完所有接口. 但是呢,在换到新公司后,发现接口请求是多式多样的,get.post必须有 ...
- Web UI开发推荐!Kendo UI for jQuery自定义小部件——使用MVVM
Kendo UI for jQuery最新试用版下载 Kendo UI目前最新提供Kendo UI for jQuery.Kendo UI for Angular.Kendo UI Support f ...
- gtid 1032同步异常处理
gtid 1032同步异常处理 .sql # 在从库中执行 ; ,); ,); ,); ,); ; mysql> select * from fudao_student_lable; +--- ...
- 【Wince-自定义控件】ImageButton 带图片、文字
1.看图 可以实现MouseDown改变背景颜色或背景图片. 遗憾是没有实现键盘触发按钮事件. 2.选择继承自Control基类 public class ImageButton : Control ...
- k8s知识1
kubernetes到底有多难?看下面的白话: service 网络通信原理service 由k8s外面的服务作为访问端 内部里面其实是pod————————————————————————————— ...
- Monkey初步使用
版权声明: 本账号发布文章均来自公众号,承香墨影(cxmyDev),版权归承香墨影所有. 允许有条件转载,转载请附带底部二维码. 一.什么是Monkey Monkey是Android自身提供的,可以通 ...