我的几个报错:

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. Java多线程的同步机制(synchronized)

    一段synchronized的代码被一个线程执行之前,他要先拿到执行这段代码的权限,在 java里边就是拿到某个同步对象的锁(一个对象只有一把锁): 如果这个时候同步对象的锁被其他线程拿走了,他(这个 ...

  2. CentOS 配置集群机器之间SSH免密码登录

    SSH 为 Secure Shell 的缩写,由 IETF 的网络小组(Network Working Group)所制定:SSH 为建立在应用层和传输层基础上的安全协议.SSH 是目前较可靠,专为远 ...

  3. html 用一个frame刷新另一个frame(同一个Frameset中)

    假设主页面index.html,其中frameset结构如下所示: <html> <head> <meta http-equiv="Content-Type&q ...

  4. Java知多少(58)线程Runnable接口和Thread类详解

    大多数情况,通过实例化一个Thread对象来创建一个线程.Java定义了两种方式: 实现Runnable 接口: 可以继承Thread类. 下面的两小节依次介绍了每一种方式. 实现Runnable接口 ...

  5. 安卓开发笔记——关于开源项目SlidingMenu的使用介绍(仿QQ5.0侧滑菜单)

    记得去年年末的时候写过这个侧滑效果,当时是利用自定义HorizontalScrollView来实现的,效果如下: 有兴趣的朋友可以看看这篇文件<安卓开发笔记——自定义HorizontalScro ...

  6. offsetHeight,clientHeight,scrollHeight,offsetY等属性的理解

    el.offsetHeight = height + padding + border(滚动条是在边框内的,自然也包括在内) el.clientHeight = 可视化看到的高度 (就是content ...

  7. xss攻击问题以及如何防范

    当用户提交评论的时候,比如如下评论内容 111 <scripy>alert(111);</scripy> 这样当现实评论的时候会先弹出111弹框,再显示评论.这就是xss攻击. ...

  8. ubuntu如何设置开机启动默认命令行界面

    图形模式下,首先进入终端: 1. 运行 sudo vi/etc/default/grub 2. 找到 GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” 3.改为 GR ...

  9. Web(一)

    Tomcat 服务器       B/S 浏览器/服务器       C/S 客户端/服务器  URI :大 广 /项目名                      URL: 小  http://lo ...

  10. 有关 PHP 的 10 道问题

    1.简述面向对象的三大特性 答:封装 --  继承  --  多态 封装的目的:为了让类更安全 继承的概念:子类可以继承父类的一切 多态的概念:当父类引用指向子类实例,由于子类里面对父类的方法进行了重 ...