zoukankan      html  css  js  c++  java
  • ansibel playbook 实例1

    node2:/root/sbin#cat /etc/ansible/hosts
    [webservers]
    192.168.137.2
    192.168.137.3
    115.236.19.4:9998
    1.1.1.1
    node2:/root/sbin#cat test_connect.
    cat: test_connect.: No such file or directory
    node2:/root/sbin#cat test_connect.yml 
    ---
    - hosts: webservers
      remote_user: root
      tasks:
        - name: test connection
          ping:
          remote_user: root
    node2:/root/sbin#ansible-playbook -i /etc/ansible/hosts test_connect.yml 
    
    PLAY [webservers] *******************************************************************************************************
    
    TASK [Gathering Facts] **************************************************************************************************
    ok: [192.168.137.2]
    ok: [192.168.137.3]
    fatal: [1.1.1.1]: UNREACHABLE! => {"changed": false, "msg": "timed out", "unreachable": true}
    fatal: [115.236.19.4]: UNREACHABLE! => {"changed": false, "msg": "timed out", "unreachable": true}
    
    TASK [test connection] **************************************************************************************************
    ok: [192.168.137.3]
    ok: [192.168.137.2]
    	to retry, use: --limit @/root/sbin/test_connect.retry
    
    PLAY RECAP **************************************************************************************************************
    1.1.1.1                    : ok=0    changed=0    unreachable=1    failed=0   
    115.236.19.4               : ok=0    changed=0    unreachable=1    failed=0   
    192.168.137.2              : ok=2    changed=0    unreachable=0    failed=0   
    192.168.137.3     
  • 相关阅读:
    1436 孪生素数 2
    1702 素数判定 2
    第五章 Spring3.0 、Hibernate3.3与Struts2的整合 基于Annotation
    逻辑服务器和数据缓存服务器交互方式整理
    Solr学习(2) Solr4.2.0+IK Analyzer 2012
    hdu4288 Coder
    解决Robotium测试用例crash问题
    FineUI_动态绑定Grid
    Protection 5 ---- Priviliege Level Checking 2
    用户权限管理
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349110.html
Copyright © 2011-2022 走看看