nginx setup with anisble
This commit is contained in:
parent
fbad8e3a64
commit
cd42d0c281
0
infra/static-vultr/ansible/files/shockrah.xyz.conf
Normal file
0
infra/static-vultr/ansible/files/shockrah.xyz.conf
Normal file
35
infra/static-vultr/ansible/tasks/nginx-setup.yml
Normal file
35
infra/static-vultr/ansible/tasks/nginx-setup.yml
Normal file
@ -0,0 +1,35 @@
|
||||
- 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
|
||||
- resume.shockrah.xyz
|
||||
- temper.tv
|
||||
- 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
|
||||
- resume.shockrah.xyz
|
||||
- temper.tv
|
||||
- name: Restart nginx conf to pick up new config changes
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
Loading…
Reference in New Issue
Block a user