nginx-html-root/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sat, 16 May 2020 09:55:46 -0500
changeset 25 b4e52ddd1210
parent 16 c2ff7e33d1e5
permissions -rw-r--r--
Removed newlines at end of minecraft config files to avoid generating changes after server removes them.

---

- name: install nginx packages
  become: yes
  apt: name="nginx"

- name: disable default site
  become: yes
  file: path="/etc/nginx/sites-enabled/default" state="absent"
  notify: restart nginx

- name: create http directory
  become: yes
  file: path="{{nginx_html_root}}" state="directory"

- name: install root files
  become: yes
  copy: src="{{nginx_html_src}}" dest="{{nginx_html_root}}"

- name: enable nginx service
  become: yes
  systemd: name="nginx" enabled="yes" state="started"