infra/ansible/playbooks/refresh-nginx.yml
shockrah be13e9e71f
Some checks failed
Actions demo / simple-echo (push) Failing after 1s
Moving ansible playbook stuff to its new resting place
2024-08-17 16:24:41 -07:00

31 lines
786 B
YAML

---
- hosts: webhost
remote_user: root
vars:
websites:
- shockrah.xyz
- git.shockrah.xyz
- 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