我的几个报错:

1.远程复制失败

[root@localhost ~ ]#scp -r .ssh 192.168.10.145:/root/

root@192.168.10.145's password:

bash: scp: command not found

lost connection

解决思路:发现没装openssh-clients客户端工具

[root@centos6 ~ ]#rpm -qa openssh*

openssh-5.3p1-122.el6.x86_64

openssh-server-5.3p1-122.el6.x86_64

[root@centos6 ~ ]#yum install openssh-clients

3.
[root@ansible /etc/ansible ]#ansible-playbook -C nginx.yml
[WARNING]: While constructing a mapping from /etc/ansible/roles/nginx/tasks/main.yml, line 6, column 3, found a duplicate dict key (template). Using
last defined value only.

[WARNING]: Ignoring invalid attribute: with_item

4.
fatal: [192.168.10.145]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'item' is undefined\n\nThe error appears to have been in '/etc/ansible/roles/nginx/handlers/main.yml': line 1, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: reload the service\n ^ here\n"}
fatal: [192.168.10.144]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'item' is undefined\n\nThe error appears to have been in '/etc/ansible/roles/nginx/handlers/main.yml': line 1, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: reload the service\n ^ here\n"}

装这几个工具是方便-键操作

yum install ntpdate -y

ansible all -a 'yum install ntpdate -y'

ansible all -a '/usr/sbin/ntpdate stdtime.gov.hk'

ansible all -a 'yum install tree -y'

ansible all -a 'yum install openssh-clients -y'

2.同步失败

[root@centos7 ~ ]#ansible all -a 'ntpdate time.nist.gov'

192.168.10.144 | FAILED | rc=1 >>

5 May 19:00:00 ntpdate[37327]: no server suitable for synchronization foundnon-zero return code

解决方法:

第1:先要确定,系统确实可以上网,ping baidu.com 能通就行

第2:/usr/sbin/ntpdate stdtime.gov.hk 就行了

ansible--我的几个报错的更多相关文章

  1. Aasible中cryptography兼容性报错解决办法

    Aasible中cryptography兼容性报错解决办法 1 Ansible中使用ansible --version查看版本,报错信息如下: ERROR! Unexpected Exception, ...

  2. Ansible 脚本运行一次后,再次运行时出现报错情况,原因:ansible script 的格式不对,应改成Unix编码

    Ansible 脚本运行一次后,再次运行时出现报错情况,原因:ansible  script 的格式不对,应改成Unix编码 find . -name "*" | xargs do ...

  3. 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 ...

  4. ansible报错Aborting, target uses selinux but python bindings (libselinux-python) aren't installed【转】

    报错内容: TASK [activemq : jvm configuration] ********************************************************** ...

  5. Ansible 连接主机显示报错的处理方案

    一.在ansible安装完毕后一般需要以SSH的方式连接到需要进行管理的目标主机,一开始遇到了如下问题: 192.168.15.4 | UNREACHABLE! => {    "ch ...

  6. ansible报错AttributeError: module 'urllib.request' has no attribute 'HTTPSHandler'

    报错内容: TASK [activemq : extract activemq tarball] *************************************************** ...

  7. [vsftpd] ubuntu14.04 ansible剧本安装vsftpd流程及报错排查

    需求: 在ubuntu14.04机器上搭建ftp服务,ftp账号通过winscp软件登录后,仅可增删改/data/wwwroot目录. 一.安装步骤 1.apt 安装vsftpd apt-get in ...

  8. ansible报错Aborting, target uses selinux but python bindings (libselinux-python) aren't installed

    报错内容: TASK [activemq : jvm configuration] ********************************************************** ...

  9. PXE+kickstart网络安装CentOS7.4系统及过程中各种报错

    环境:关闭防火墙.selinux 注意:虚拟机进行网络安装的话,7.3以后的系统是需要2G以上的内存 [root@kickstart ~]# cat /etc/redhat-release CentO ...

  10. yum安装的时候报错,关于python的函数库

    我在执行yum -y install nc命令的时候出现如下报错 There was a problem importing one of the Python modulesrequired to ...

随机推荐

  1. 【emWin】例程十四:xbf外置字体

    介绍: 本例将xbf格式文件放到SD卡中,通过读取SD卡中的字库文件在液晶上显示文字.   实验指导书及代码包下载: 链接:http://pan.baidu.com/s/1mhTdYeG 密码:aka ...

  2. form表单下的button按钮会自动提交表单的问题

    form表单下的button按钮会自动提交表单的问题 2017年01月05日 18:02:44 蓝色水 阅读数:18012更多 个人分类: asp.net   form表单下的按钮在没有指定type类 ...

  3. 30分钟入门Java8之lambda表达式

    前言 Google在今年发布Android N开发者预览版,一并宣布开始支持Java 8.我们终于能在Android开发中使用到Java8的一些语言特性了.目前支持: 默认方法 lambda表达式 多 ...

  4. oracle表空间不足扩容的方法

    1.查询当前用户的所属表空间 select * from user_users; 2.增加表空间有两种方法: 以sysdba登陆进数据库 语法: alter tablespace 表空间名称 add ...

  5. android SQLite数据库的基本操作

    SQLite是Android使用的轻量级的数据库,开发Android应用是对数据库的操作自然是必不可少. Android提供了一个SQLiteOpenHelper类来可以很方便的操作数据库, 继承和扩 ...

  6. react学习笔记(一)用create-react-app构建 React 开发环境

    React 可以高效.灵活的用来构建用户界面框架,react利用高效的算法最小化重绘DOM. create-react-app 是来自于 Facebook,通过该命令不需配置就能快速构建 React ...

  7. c++中SetEvent和ResetEvent的使用

    关于事件 事件(Event)是WIN32提供的最灵活的线程间同步方式,事件可以处于激发状态(signaled or true)或未激发状态(unsignal or false).根据状态变迁方式的不同 ...

  8. django 1.11.1 连接MySQL

    一.定义数据库 settings.py搜索   DATABASES 参考路径:   D:\Python27\Lib\site-packages\django\bin\app\app\settings. ...

  9. NIO相关概念之Scatter / Gather

    Scatter /Gather 是java NIO中用来对channel的读取或者写入操作的特殊的形式的描述 Scatter(发散) 是指在读操作的时候,从chanel读取到的数据,写入到多个buff ...

  10. Nodejs----登录验证

    1. 写在前面 当我们登录了一个网站,在没有退出登录的情况下,我们关闭了这个网站 ,过一段时间,再次打开这个网站,依然还会是登录状态.这是因为,当我们登录了一个网站,服务器会保存我们的登录状态,直到我 ...