zoukankan      html  css  js  c++  java
  • Ansible 初探

    Ansible  

    一 简介

        http://www.ansible.com.cn/

        源码安装:

          

    $ git clone git://github.com/ansible/ansible.git --recursive
    $ cd ./ansible
    $ source ./hacking/env-setup
    

      

    二 使用

    $ ansible TestsMonkey  -m command -a  'adb devices'
    Test5 | success | rc=0 >>
    List of devices attached
    0499	device
    0309	device
    
    Test9 | success | rc=0 >>
    List of devices attached
    
    Test6 | success | rc=0 >>
    List of devices attached
    0671	device
    1422	device
    0812	device
    
    Test7 | success | rc=0 >>
    List of devices attached
    1356	device
    0123456789ABCDEF	device
    1091	device
    
    Test8 | success | rc=0 >>
    List of devices attached
    1299	device
    1570	device
    1265	device
    
    $ cat ~/ansible_hosts
    [Local]
    127.0.0.1
    [TestsMonkey]
    Test[5:9] ansible_ssh_user=jenkins ansible_ssh_pass=W
    

    三 ad-hoc

    Ansible提供两种方式去完成任务,一是 ad-hoc 命令,一是写 Ansible playbook.前者可以解决一些简单的任务, 后者解决较复杂的任务.

    File Transfer

    $ ansible atlanta -m copy -a "src=/etc/hosts dest=/tmp/hosts"

    Managing Packages

    Users and Groups

    Managing Services

    Deploying From Source Control

    Gathering Facts



    四 配置文件

    Questions :

    ansible  : echo $PATH只有global path ?

  • 相关阅读:
    Django-xadmin
    Django-DRF框架中认证与权限
    Django-DRF视图集
    Django-DRF序列化器
    javascript
    web-api
    ES6语法
    Redis缓存雪崩、击穿、穿透
    Jetbrains IDEA 系列软件最新crack方案
    jmeter设置代理服务器录制脚本
  • 原文地址:https://www.cnblogs.com/zsr0401/p/6270336.html
Copyright © 2011-2022 走看看