zoukankan      html  css  js  c++  java
  • ansible学习02

    ansible 对主机清单进行磁盘使用查看

    vi  /etc/ansible/hosts

    [webservers]
    ## alpha.example.org
    ## beta.example.org
    ## 192.168.1.100
    ## 192.168.1.110
    192.168.10.127
    192.168.10.128

    [root@localhost ansible]# ansible all -m shell -a "df -h" -k
    SSH password:
    192.168.10.128 | FAILED | rc=-1 >>
    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.10.127 | CHANGED | rc=0 >>
    Filesystem Size Used Avail Use% Mounted on
    devtmpfs 1.8G 0 1.8G 0% /dev
    tmpfs 1.8G 0 1.8G 0% /dev/shm
    tmpfs 1.8G 13M 1.8G 1% /run
    tmpfs 1.8G 0 1.8G 0% /sys/fs/cgroup
    /dev/mapper/centos-root 33G 4.0G 29G 13% /
    /dev/mapper/centos-var 6.1G 857M 5.2G 14% /var
    /dev/sda1 197M 150M 48M 76% /boot
    tmpfs 367M 52K 367M 1% /run/user/1000
    tmpfs 367M 0 367M 0% /run/user/0

    修改 vi  /etc/ansible/ansible.cfg 

    #host_key_checking = False  注释行注释取消

    host_key_checking = False

  • 相关阅读:
    VScode网页开发工具
    Java修饰符总结
    C++进阶补充
    C++进阶
    计算机简单开发的基础
    C++动态规划和递归
    C++设计模式
    C++ virtual
    C++-基于STL的演讲比赛流程管理系统
    C++6(5补充)
  • 原文地址:https://www.cnblogs.com/vzhangxk/p/15007120.html
Copyright © 2011-2022 走看看