36 lines
1.3 KiB
YAML
36 lines
1.3 KiB
YAML
- name: Download Minecraft modpack installer
|
|
ansible.builtin.get_url:
|
|
url: "{{ minecraft_modpack_url }}"
|
|
dest: "{{ minecraft_home }}/{{ item.name }}/serverinstall_{{ item.modpack | replace ('/', '_') }}"
|
|
owner: "{{ minecraft_user }}"
|
|
group: "{{ minecraft_user }}"
|
|
mode: 0700
|
|
loop: "{{ minecraft }}"
|
|
when: item.modpack is defined and item.sha1 is not defined
|
|
|
|
- name: Run Minecraft modpack installer
|
|
ansible.builtin.command: "sudo -u {{ minecraft_user }} ./serverinstall_{{ item.modpack | replace ('/', '_') }} --auto"
|
|
args:
|
|
creates: "{{ minecraft_home }}/{{ item.name }}/mods"
|
|
chdir: "{{ minecraft_home }}/{{ item.name }}"
|
|
loop: "{{ minecraft }}"
|
|
when: item.modpack is defined and item.sha1 is not defined
|
|
|
|
- name: Find Minecraft Forge
|
|
ansible.builtin.find:
|
|
paths: "{{ minecraft_home }}/{{ item.name }}"
|
|
patterns: "forge*.jar"
|
|
register: minecraft_forge
|
|
loop: "{{ minecraft }}"
|
|
when: item.modpack is defined and item.sha1 is not defined
|
|
|
|
- name: Link to Minecraft Forge
|
|
ansible.builtin.file:
|
|
src: "{{ item.files[0].path }}"
|
|
dest: "{{ minecraft_home }}/{{ item.item.name }}/minecraft_server.jar"
|
|
owner: "{{ minecraft_user }}"
|
|
group: "{{ minecraft_user }}"
|
|
state: link
|
|
loop: "{{ minecraft_forge.results }}"
|
|
when: minecraft_forge is defined and item.files[0].path is defined
|