Devops利器ansible

安装epel源

  • ansible已经被收入到epel源中了
[root@master ~]# yum install epel-release -y
[root@master ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.zju.edu.cn
 * epel: fedora.cs.nctu.edu.tw
 * extras: mirrors.163.com
 * updates: mirrors.njupt.edu.cn
repo id                             repo name                                                         status
base/7/x86_64                       CentOS-7 - Base                                                   10,097
epel/x86_64                         Extra Packages for Enterprise Linux 7 - x86_64                    13,212
extras/7/x86_64                     CentOS-7 - Extras                                                    335
updates/7/x86_64                    CentOS-7 - Updates                                                 1,77
[root@master ~]# yum install ansible -y

查看ansible的版本信息
[root@master ~]# ansible --version
ansible 2.9.6
config file = /etc/ansible/ansible.cfg
configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

ansible相关文件和目录

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

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

  • ansible的主配置文件

  • /etc/ansible/ansible.cfg

[defaults]
#inventory         = /etc/ansible/hosts     # 指定主机清单文件
#forks             = 5                      # 指定每批次向几台主机发送指令
#sudo_user         = root                   # sudo的目标用户
#remote_port       = 22                     # 设置ssh端口号
#roles_path        = /etc/ansible/roles     # role文件的路径
#host_key_checking = False                  # 设置是否检查目标主机的指纹信息
#module_name       = command                # 设置默认模块名称 

[privilege_escalation]
#become=True                                # 是否允许进行sudo
#become_method=sudo
#become_user=root
#become_ask_pass=False

``

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值