shockrah
02a47b8418
* Uncommenting test code which was working fine The commented lines have ran but other things broke, and they weren't patched in correctly.
70 lines
1.4 KiB
YAML
70 lines
1.4 KiB
YAML
---
|
|
- hosts: leftcoastlab
|
|
become: yes
|
|
vars:
|
|
STATIC_USER: staticweb
|
|
tasks:
|
|
- name: Install Nginx Package
|
|
apt:
|
|
name: nginx
|
|
update_cache: yes
|
|
state: present
|
|
|
|
- name: Stop Apache2 Service
|
|
systemd:
|
|
name: apache2
|
|
state: stopped
|
|
enabled: no
|
|
|
|
- name: Remove Apache2
|
|
apt:
|
|
name: apache2
|
|
state: absent
|
|
|
|
- name: website user account
|
|
user:
|
|
name: "{{STATIC_USER}}"
|
|
comment: Static Website maintainer account
|
|
state: present
|
|
|
|
- name: Create Static web root directory
|
|
file:
|
|
path: /var/www
|
|
state: directory
|
|
recurse: yes
|
|
owner: "{{STATIC_USER}}"
|
|
group: "{{STATIC_USER}}"
|
|
|
|
- name: Copy Reverse proxy configs
|
|
copy:
|
|
src: "{{ item }}"
|
|
dest: /etc/nginx/sites-available/
|
|
loop:
|
|
- ../files/git.lablad
|
|
- ../files/music.lablad
|
|
- ../files/files.lablad
|
|
- ../files/metrics.lablad
|
|
- ../files/metrics.lablad
|
|
- ../files/todo.lablad
|
|
|
|
- name: Enable Sites
|
|
file:
|
|
src: /etc/nginx/sites-available/{{item}}
|
|
dest: /etc/nginx/sites-enabled/{{item}}
|
|
state: link
|
|
loop:
|
|
- git.lablad
|
|
- music.lablad
|
|
- files.lablad
|
|
- metrics.lablad
|
|
- todo.lablad
|
|
notify:
|
|
- restart-nginx
|
|
|
|
handlers:
|
|
- import_tasks: ../handlers/nginx.yml
|
|
|
|
|
|
|
|
|