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

View File

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

View File

@ -61,14 +61,6 @@
file: file:
path: "/var/minecraft/{{ mcname }}/modpack.zip" path: "/var/minecraft/{{ mcname }}/modpack.zip"
state: absent 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 - name: Download Forge
get_url: get_url:
dest: "/var/minecraft/{{ mcname }}/installer.jar" dest: "/var/minecraft/{{ mcname }}/installer.jar"
@ -91,6 +83,16 @@
src: "/var/minecraft/{{ mcname }}/forge-{{ mcforge }}-universal.jar" src: "/var/minecraft/{{ mcname }}/forge-{{ mcforge }}-universal.jar"
state: link state: link
when: not stat_mcroot_forgejar.stat.exists 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: yes
become_user: minecraft become_user: minecraft
- name: Enable service - name: Enable service

View File

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

View File

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