Skip to content

Commit 1a04db9

Browse files
committed
Add new file
1 parent b3db720 commit 1a04db9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

playbooks/nginx.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
- hosts: all
3+
remote_user: root
4+
tasks:
5+
6+
- name: "配置nginx官方安装源"
7+
copy: src=/etc/yum.repos.d/nginx.repo dest=/etc/yum.repos.d/nginx.repo
8+
- name: "安装Nginx,tree,screen软件包"
9+
yum: name={{ item }} state=present
10+
with_items:
11+
- nginx
12+
- tree
13+
- screen
14+
15+
- name: "分发配置文件"
16+
copy:
17+
src: /etc/nginx/nginx.conf
18+
dest: /etc/nginx/nginx.conf
19+
owner: root
20+
group: root
21+
mode: 0644
22+
backup: yes
23+
24+
- name: "写入index.html"
25+
shell: echo "I am $(hostname)" > /usr/share/nginx/html/index.html
26+
27+
- name: "开启nginx服务"
28+
service: name=nginx state=started enabled=yes

0 commit comments

Comments
 (0)