diff --git a/roles/minecraft/defaults/main.yml b/roles/minecraft/defaults/main.yml index 8ef5b63..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" diff --git a/roles/minecraft/tasks/main.yml b/roles/minecraft/tasks/main.yml index 82ab92c..5edfe60 100644 --- a/roles/minecraft/tasks/main.yml +++ b/roles/minecraft/tasks/main.yml @@ -75,8 +75,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