Install Nginx (with default page running)
This commit is contained in:
parent
3ba044d1a2
commit
a08eb939b6
3 changed files with 29 additions and 1 deletions
|
|
@ -1,2 +1,2 @@
|
||||||
---
|
---
|
||||||
cloudflare_ddns_user: 'cloudflare_ddns'
|
cloudflare_ddns_user: cloudflare_ddns
|
||||||
|
|
|
||||||
26
roles/reverse-proxy/tasks/main.yml
Normal file
26
roles/reverse-proxy/tasks/main.yml
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
- name: Add an apt key by id from a keyserver
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt_key:
|
||||||
|
url: https://nginx.org/packages/keys/nginx_signing.key
|
||||||
|
state: present
|
||||||
|
- name: Add Nginx repository into sources list
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt_repository:
|
||||||
|
repo: deb https://nginx.org/packages/debian/ {{ ansible_facts['lsb']['codename'] }} nginx
|
||||||
|
state: present
|
||||||
|
- name: Add Nginx source repository into sources list
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt_repository:
|
||||||
|
repo: deb-src https://nginx.org/packages/debian/ {{ ansible_facts['lsb']['codename'] }} nginx
|
||||||
|
state: present
|
||||||
|
- name: Install Nginx
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: nginx # Creates the "nginx" user as well
|
||||||
|
state: present
|
||||||
|
- name: Start Nginx
|
||||||
|
become: true
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: nginx.service
|
||||||
|
state: started
|
||||||
2
roles/reverse-proxy/vars/main/defaults.yml
Normal file
2
roles/reverse-proxy/vars/main/defaults.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
nginx_user: nginx # Created automatically by the apt installation
|
||||||
Loading…
Add table
Add a link
Reference in a new issue