批量安装一个nginx
- hosts: all
tasks:
- name: 01-backup file
command: mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.back
- name: 02-download aliyun
shell: wget -P /etc/yum.repos.d/ -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- name: 03-clean
shell: yum clean all
- name: installed
yum: name=nginx state=installed
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
