Use Ansible for uploading files and managing NGINX

This commit is contained in:
Oliver Davies 2024-05-03 21:40:02 +01:00
parent 45e8206df8
commit cd6575c6fc
7 changed files with 489 additions and 3 deletions

View file

@ -0,0 +1,16 @@
---
- hosts: all
become: true
vars:
domain: www.oliverdavies.uk
tasks:
- ansible.builtin.copy:
src: ../nginx/{{ domain }}.conf
dest: /etc/nginx/sites-available/{{ domain }}.conf
- ansible.builtin.file:
src: /etc/nginx/sites-available/{{ domain }}.conf
dest: /etc/nginx/sites-enabled/{{ domain }}.conf
state: link