zoukankan      html  css  js  c++  java
  • ansible--我的几个报错

    我的几个报错:

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

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

    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 就行了

  • 相关阅读:
    神经网络-FPN 19
    机器学习
    神经网络-DenseNet 18
    神经网路骨架:各自的特点统计
    转载:一步一步制作根文件系统
    设计模式博客
    【转】PowerPC平台linux设备移植
    【收藏】自己动手写编译器、连接器
    查看pthread线程库中锁的持有者方法
    【转】深入 Linux 的进程优先级
  • 原文地址:https://www.cnblogs.com/dbslinux/p/9314790.html
Copyright © 2011-2022 走看看