2024-04-16 00:58:23 +00:00
|
|
|
- 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:
|
2024-04-20 20:23:24 +00:00
|
|
|
src: "../files/{{ item }}"
|
2024-04-16 00:58:23 +00:00
|
|
|
dest: /etc/nginx/sites-available/
|
|
|
|
loop:
|
2024-04-17 03:37:47 +00:00
|
|
|
- shockrah.xyz.conf
|
|
|
|
- resume.shockrah.xyz.conf
|
|
|
|
- temper.tv.conf
|
2024-04-16 00:58:23 +00:00
|
|
|
- name: Enable the site configs with sym links
|
|
|
|
file:
|
|
|
|
src: "/etc/nginx/sites-available/{{ item }}"
|
|
|
|
dest: "/etc/nginx/sites-enabled/{{ item }}"
|
|
|
|
state: link
|
|
|
|
loop:
|
2024-04-17 03:37:47 +00:00
|
|
|
- shockrah.xyz.conf
|
|
|
|
- resume.shockrah.xyz.conf
|
|
|
|
- temper.tv.conf
|
2024-04-16 00:58:23 +00:00
|
|
|
- name: Restart nginx conf to pick up new config changes
|
|
|
|
service:
|
|
|
|
name: nginx
|
|
|
|
state: restarted
|