From 36c61436ed21aa84a456613168b78644306d4f4a Mon Sep 17 00:00:00 2001 From: Salt Date: Mon, 21 Dec 2020 01:22:24 -0600 Subject: [PATCH] Update minecraft role --- roles/minecraft/defaults/main.yml | 5 ++++- roles/minecraft/tasks/main.yml | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/roles/minecraft/defaults/main.yml b/roles/minecraft/defaults/main.yml index 77c7f5b..fdd4468 100644 --- a/roles/minecraft/defaults/main.yml +++ b/roles/minecraft/defaults/main.yml @@ -20,6 +20,9 @@ minecraft_forge_downloadurl: "https://files.minecraftforge.net/maven/net/minecra #minecraft_forge_packurl: https://path.to.your/modpack.zip # Define THIS if you want to download a bunch of mods by JAR URL: minecraft_forge_mods: [] +# Define THIS if you want to remove any mods that come with a pack by default +# Just a list of filenames in /mods. Matches directories, too +minecraft_forge_mods_remove: [] minecraft_vanilla_install: no minecraft_vanilla_downloadurl: "https://launcher.mojang.com/v1/objects/35139deedbd5182953cf1caa23835da59ca3d7cd/server.jar" @@ -38,4 +41,4 @@ minecraft_jre_xmx: 4096m # - { opt: allow-flight, value: "false" } # - opt: gamemode # value: 0 -minecraft_server_properties: {} +minecraft_server_properties: [] diff --git a/roles/minecraft/tasks/main.yml b/roles/minecraft/tasks/main.yml index 4d5f10e..287f526 100644 --- a/roles/minecraft/tasks/main.yml +++ b/roles/minecraft/tasks/main.yml @@ -36,7 +36,7 @@ # TODO: Manage configs for plugins, auto-install plugins become: yes become_user: minecraft - when: minecraft_fabric_install + when: minecraft_paper_install - name: set up forge block: - name: template out modpack installer @@ -73,8 +73,13 @@ - name: install mods get_url: dest="{{ minecraft_home }}/{{ minecraft_name }}/mods" url={{ item }} loop: "{{ minecraft_forge_mods }}" - notify: restart minecraft {{ minecraft_name }} + notify: "restart minecraft {{ minecraft_name }}" when: minecraft_forge_mods is iterable and minecraft_forge_mods != None + - name: remove mods + file: path={{ minecraft_home }}/{{ minecraft_name }}/mods/{{ item }} state=absent + loop: "{{ minecraft_forge_mods_remove }}" + notify: "restart minecraft {{ minecraft_name }}" + when: minecraft_forge_mods_remove is iterable and minecraft_forge_mods_remove != None become: yes become_user: minecraft when: minecraft_forge_install and minecraft_forge_version is defined