zoukankan      html  css  js  c++  java
  • Ansible基础

    Ansible

    GitHub:https://github.com/ansible/

    官方:https://www.ansible.com

    官方文档:https://docs.ansible.com

    Ansible命令使用

    Ansible语法使用ansible <pattern_goes_here> -m <module_name> -a <arguments>

    -m NAME,–module-name=NAME:指定执行使用的模块

    -u USERNAME,–user=USERNAME:指定远程主机以USERNAME运行命令

    -s,–sudo:相当于Linux系统下的sudo命令

    -USUDO_USERNAME,–sudo-user=SUDO_USERNAME:使用sudo,相当于Linux下的sudo命令

    -C -check只检查不实际执行

    -e EXTRA_VARS,引用外部参数

    -i INVENTORY,指定仓库列表,默认/etc/ansible/hosts

    –list-hosts,列出执行主机列

    安装目录

    配置文件目录:/etc/ansible/

    执行文件目录:/usr/bin/

    Lib库依赖目录:/usr/lib/pythonX.X/site-packages/ansible/

    Help文档目录:/usr/share/doc/ansible-X.X.X/

    Man文档目录:/usr/share/man/man1/

    安装

    1.安装

    [root@docker ~]# git clone git://github.com/ansible/ansible.git --recursive
    [root@docker ~]# cd ansible/
    

     2.进行源码安装

    [root@docker ansible]# make && make install
    

     3.先安装pip包管理工具,然后安装ansible 程序所使用的几个python模块

    [root@docker ansible]# easy_install pip
    [root@docker ansible]# pip install paramiko PyYAML Jinja2 httplib2 six
    

     4.更新ansible 代码时用到的两条命令

    [root@docker ansible]# git pull --rebase
    Current branch devel is up to date.
    [root@docker ansible]# git submodule update --init --recursive
    
  • 相关阅读:
    软连接
    libmysqlclient.so.18 not found 的解决方法
    查找某个文件并全部删除
    sudo passwd root:没有相关指令
    智能解析套件
    日志类封装
    windows安装mysql
    xshell报错Socket error Event: 32 Error: 10053
    appium简明教程(8)——那些工具
    appium简明教程(7)——Desired Capabilities详解
  • 原文地址:https://www.cnblogs.com/cevinchen/p/9513600.html
Copyright © 2011-2022 走看看