initial commit
This commit is contained in:
39
README.org
Normal file
39
README.org
Normal file
@@ -0,0 +1,39 @@
|
||||
#+TITLE: Nginx Web Server Installer Role
|
||||
#+AUTHOR: DeadSwitch | The Silent Architect
|
||||
#+OPTIONS: toc:nil num:nil \n:t
|
||||
|
||||
* ds-nginx
|
||||
|
||||
This Ansible role installs the Nginx web server.
|
||||
|
||||
- Disables the =default= site.
|
||||
- No other site configuration.
|
||||
- No additional hardening.
|
||||
|
||||
* Requirements
|
||||
|
||||
- Debian 12+ or compatible.
|
||||
- Sudo access or root.
|
||||
- Port 80 (and 443) are reachable.
|
||||
|
||||
* Example Playbook
|
||||
|
||||
#+begin_src yaml
|
||||
- name: Install the Nginx web server
|
||||
hosts: webservers
|
||||
become: true
|
||||
|
||||
roles:
|
||||
- role: ds-nginx
|
||||
#+end_src
|
||||
|
||||
* Handlers
|
||||
|
||||
- =Reload_nginx=
|
||||
- =Restart_nginx=
|
||||
|
||||
* License
|
||||
|
||||
MIT License
|
||||
|
||||
=[ Fear the Silence. Fear the Switch. ]=
|
||||
10
handlers/main.yml
Normal file
10
handlers/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Reload_nginx
|
||||
ansible.builtin.systemd_service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
|
||||
- name: Restart_nginx
|
||||
ansible.builtin.systemd_service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
17
tasks/main.yml
Normal file
17
tasks/main.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Install the nginx server
|
||||
ansible.builtin.apt:
|
||||
name: nginx
|
||||
state: present
|
||||
|
||||
- name: Disable the default nginx site
|
||||
ansible.builtin.file:
|
||||
path: /etc/nginx/sites-enabled/default
|
||||
state: absent
|
||||
notify: Reload_nginx
|
||||
|
||||
- name: Enable and start the nginx
|
||||
ansible.builtin.service:
|
||||
name: nginx
|
||||
state: started
|
||||
enabled: true
|
||||
Reference in New Issue
Block a user