-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.yaml
34 lines (28 loc) · 813 Bytes
/
nginx.yaml
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
---
- name: Nginx Setup
hosts: localhost
become: true
connection: local
tasks:
- name: Updating Packages
ansible.builtin.apt:
update_cache: yes
- name: Installing Nginx
ansible.builtin.apt:
name: nginx
state: latest
- name: Download file using get_url module
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/anjanahkarthic/html/refs/heads/main/index.html
dest: /var/www/html/index.html
mode: '0644'
- name: Starting nginx service
ansible.builtin.service:
name: nginx
state: started
- name: Getting the status of the nginx service
shell: "systemctl status nginx | grep 'since'"
register: status
- name: Show nginx status
debug:
var: status.stdout