博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ansible基础
阅读量:7084 次
发布时间:2019-06-28

本文共 1152 字,大约阅读时间需要 3 分钟。

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 --rebaseCurrent branch devel is up to date.[root@docker ansible]# git submodule update --init --recursive

 

转载于:https://www.cnblogs.com/cevinchen/p/9513600.html

你可能感兴趣的文章
read和变量设定方式
查看>>
Winmail + Rsync + Nmap 实现 Winmail 邮件系统双机热备
查看>>
python读写文件
查看>>
1-4常用路由协议的梳理
查看>>
Javascript核心
查看>>
利用UltraISO制作RedhatU盘启动盘
查看>>
一分钟教你快速建立起MySQL/Mariadb 主从状态检测脚本(shell)
查看>>
hive函数 -- regexp_extract
查看>>
C# vs2010 调用webservice
查看>>
Samba用户管理机制
查看>>
解决securecrt连接centos使用VIM编辑中文时乱码
查看>>
Windows server 2008R2域的安装和访问
查看>>
spring boot简单实现rest服务
查看>>
linux内核编译安装
查看>>
在CentOS/RHEL/Scientific Linux 6 & 7 上安装Telnet
查看>>
linux中hash命令:显示、添加或清除哈希表
查看>>
理解MySQL复制(Replication)——经典文献
查看>>
安卓手机recovery下刷补丁提示:“can't open /sdcard/update.zip(bad)”
查看>>
shared_ptr源码分析
查看>>
AOJ 2164 Revenge of the Round Table 题解《挑战程序设计竞赛》
查看>>