2024-04-28 23:46:30 +00:00
|
|
|
---
|
|
|
|
- hosts: webhost
|
|
|
|
remote_user: root
|
|
|
|
vars:
|
|
|
|
websites:
|
|
|
|
- shockrah.xyz
|
2024-08-03 22:25:06 +00:00
|
|
|
- git.shockrah.xyz
|
2024-04-28 23:46:30 +00:00
|
|
|
- temper.tv
|
|
|
|
- resume.shockrah.xyz
|
|
|
|
tasks:
|
|
|
|
- name: Upload configs
|
|
|
|
copy:
|
|
|
|
src: "../files/{{ item }}.conf"
|
|
|
|
dest: "/etc/nginx/sites-available/{{ item }}"
|
|
|
|
loop: "{{ websites }}"
|
|
|
|
- name: Enable the site configs with sym links
|
|
|
|
file:
|
|
|
|
src: "/etc/nginx/sites-available/{{ item }}"
|
|
|
|
dest: "/etc/nginx/sites-enabled/{{ item }}"
|
|
|
|
state: link
|
|
|
|
loop: "{{ websites }}"
|
|
|
|
- name: Ensure no default available
|
|
|
|
file:
|
|
|
|
path: /etc/nginx/sites-enabled/default
|
|
|
|
state: absent
|
|
|
|
- name: Restart nginx conf to pick up new config changes
|
|
|
|
service:
|
|
|
|
name: nginx
|
|
|
|
state: restarted
|
|
|
|
|