Raspberry-Pi-IaC/roles/reverse-proxy/tasks/main.yml
2024-04-12 09:33:14 +02:00

26 lines
834 B
YAML

---
- 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