- name 包名,多个用','隔开
- state 对指定软件安装移除操作
- present 确认已安装不升级
- installed 确认已经安装
- latest 确保安装并升级
- absent removed 删除
# 安装nginx
ansible webservers -m yum -a "name=nginx state=present"
## 最新版本
ansible webservers -m yum -a "name=nginx state=latest"
# 删除包
ansible webservers -m yum -a "name=nginx state=absent"
ansible webservers -m yum -a "name=nginx state=removed"
# 安装一个包组
ansible webservers -m yum -a "name='@Development tools' state=present"