官方资料
官方网站 https://www.ansible.com/
官方文档 https://docs.ansible.com/ansible/index.html
Ubuntu 安装 Ansible
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
基础概念
- Inventory (清单),即文件
/etc/ansible/hosts
,用于分组存储要管理的目标主机 - ansible默认使用ssh同被管理主机通讯,默认使用SFTP传输文件
- ansible命令默认模块为
bash
,如果要指定不同的模块使用参数-m module
例如:ansible all -m ping
使用的是ping
模块
网友评论