-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.yml
44 lines (40 loc) · 948 Bytes
/
nginx.yml
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
41
42
43
44
---
- hosts: local
connection: local
become: yes
become_user: root
vars:
- docroot: /home/bilard/Desktop/Django-LMS/public
tasks:
- name: Add Nginx Repository
apt_repository:
repo: ppa:nginx/stable
state: present
register: ppastable
- name: Install Nginx
apt:
name: nginx
state: latest
update_cache: true
when: ppastable is success
notify:
- Start Nginx
- name: Create Web Root
file:
path: "{{docroot}}"
mode: "775"
state: directory
owner: bilard
group: bilard
notify:
- Reload Nginx
# working with handlers, their job is to listen for an event and then run when event is triggered
# handlers:
# - name: Start Nginx
# service:
# name: nginx
# state: started
# - name: Reload Nginx
# service:
# name: nginx
# state: reloaded