Myluzh Blog

Ansible-基础笔记

发布时间: 2023-3-8 文章作者: myluzh 分类名称: Linux 朗读文章


https://blog.csdn.net/m0_64496909/article/details/124913290

#yum安装ansible需要先启动EPEL仓库,具体方法自行百度。
[root@master ~]# yum install ansible --nogpgcheck

#安装完成后使用--version 查看默认配置文件
[root@master ~]# ansible --version
ansible [core 2.14.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.16 (main, Jan 17 2023, 18:53:15) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True


-i       invertory指定主机清单文件
-m     module指定模块 
-a      action指定动作(一般是模块中的选项参数或者命令)

标签: ansible

发表评论