-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathdeploy.yml
More file actions
executable file
·40 lines (35 loc) · 803 Bytes
/
deploy.yml
File metadata and controls
executable file
·40 lines (35 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
- name: Demo Web server
hosts: uk
become: yes
become_user: root
vars:
worker_con: 2020
server_port: 8099
tasks:
- name: "Install package"
yum:
name: nginx
state: latest
- name: "Open Port"
firewalld:
service: http
permanent: yes
state: enabled
- name: "Copy web content"
copy:
src: /devops_deployment/index.html
dest: /usr/share/nginx/html/index.html
tags:
- copy_file
- name: "Apply config"
template:
src: /devops_deployment/nginx.conf.j2
dest: /etc/nginx/nginx.conf
notify:
- Start service
handlers:
- name: "Start service"
service:
name: nginx
state: restarted