Use handlers for Apache restarts, reorganize Minecraft tasks

This commit is contained in:
Salt 2020-02-26 18:53:20 -06:00
parent e7623b6c77
commit 3a02792e3b
5 changed files with 17 additions and 25 deletions

View File

@ -27,6 +27,7 @@
remote_src: yes
dest: "{{ dokuwiki_webroot }}"
extra_opts: [--strip-components=1]
notify: restart apache
- name: Chown webroot
file:
path: "{{ dokuwiki_webroot }}"
@ -43,14 +44,11 @@
template:
src: apache2-vhost-ssl.conf
dest: "/etc/apache2/sites-enabled/{{ dokuwiki_url }}.conf"
notify: restart apache
- name: Generate certificate
include_role:
name: https
vars:
website_url: "{{ dokuwiki_url }}"
website_webroot: "{{ dokuwiki_webroot }}"
- name: Reload Apache
service:
name: apache2
state: reloaded
become: yes

View File

@ -14,18 +14,16 @@
git:
repo: "{{ gitweb_repo }}"
dest: "{{ gitweb_webroot }}"
notify: restart apache
- name: Copy over virtual host configs
template:
src: apache2-vhost-ssl.conf
dest: "/etc/apache2/sites-enabled/{{ gitweb_url }}.conf"
notify: restart apache
- name: Generate certificate
include_role:
name: https
vars:
website_url: "{{ gitweb_url }}"
website_webroot: "{{ gitweb_webroot }}"
- name: Reload Apache
service:
name: apache2
state: reloaded
become: yes

View File

@ -61,14 +61,6 @@
file:
path: "/var/minecraft/{{ mcname }}/modpack.zip"
state: absent
- name: Template out server.properties
template:
src: server.properties
dest: "/var/minecraft/{{ mcname }}/server.properties"
- name: Accept EULA
copy:
src: "eula.txt"
dest: "/var/minecraft/{{ mcname }}/eula.txt"
- name: Download Forge
get_url:
dest: "/var/minecraft/{{ mcname }}/installer.jar"
@ -91,6 +83,16 @@
src: "/var/minecraft/{{ mcname }}/forge-{{ mcforge }}-universal.jar"
state: link
when: not stat_mcroot_forgejar.stat.exists
- name: Configure server
block:
- name: Template out server.properties
template:
src: server.properties
dest: "/var/minecraft/{{ mcname }}/server.properties"
- name: Accept EULA
copy:
src: "eula.txt"
dest: "/var/minecraft/{{ mcname }}/eula.txt"
become: yes
become_user: minecraft
- name: Enable service

View File

@ -49,6 +49,7 @@
remote_src: yes
dest: "{{ nextcloud_webroot }}"
extra_opts: [--strip-components=1]
notify: restart apache
- name: Create data directory
file:
path: "/var/nextcloud"
@ -79,15 +80,11 @@
template:
src: apache2-vhost-ssl.conf
dest: "/etc/apache2/sites-enabled/{{ nextcloud_url }}.conf"
notify: restart apache
- name: Generate certificate
include_role:
name: https
vars:
website_url: "{{ nextcloud_url }}"
website_webroot: "{{ nextcloud_webroot }}"
- name: Reload Apache
service:
name: apache2
state: reloaded
enabled: true
become: yes

View File

@ -7,13 +7,10 @@
template:
src: apache2-redirect.conf
dest: "/etc/apache2/sites-enabled/{{ redirect_from }}.conf"
notify: restart apache
- name: Generate certificate
include_role:
name: https
vars:
website_url: "{{ redirect_from }}"
- name: Reload Apache
service:
name: apache2
state: reloaded
become: yes