infra/deprecated/playbooks/tasks/nginx-setup.yml
shockrah 79bd7424c3
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 4s
Secops Linting and Safety Checks / checkov-scan-s3 (push) Failing after 17s
Moving around more stuff
2025-05-12 00:18:24 -07:00

36 lines
854 B
YAML

- name: Install nginx
apt:
name: nginx
update_cache: yes
- name: Create user for nginx purposes
user:
name: nginx
shell: /bin/bash
create_home: false
- name: Create nginx website directory
file:
state: directory
owner: nginx
path: /opt/nginx
- name: Copy over the nginx.conf files for each server
copy:
src: "../files/{{ item }}"
dest: /etc/nginx/sites-available/
loop:
- shockrah.xyz.conf
- resume.shockrah.xyz.conf
- temper.tv.conf
- name: Enable the site configs with sym links
file:
src: "/etc/nginx/sites-available/{{ item }}"
dest: "/etc/nginx/sites-enabled/{{ item }}"
state: link
loop:
- shockrah.xyz.conf
- resume.shockrah.xyz.conf
- temper.tv.conf
- name: Restart nginx conf to pick up new config changes
service:
name: nginx
state: restarted