2021-06-17 02:49:01 +00:00
|
|
|
- name: Download Minecraft modpack installer
|
2023-05-04 03:27:03 +00:00
|
|
|
ansible.builtin.get_url:
|
2021-06-17 02:49:01 +00:00
|
|
|
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
|
2023-05-04 03:27:03 +00:00
|
|
|
ansible.builtin.command: "sudo -u {{ minecraft_user }} ./serverinstall_{{ item.modpack | replace ('/', '_') }} --auto"
|
2021-06-17 02:49:01 +00:00
|
|
|
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
|
2023-05-04 03:27:03 +00:00
|
|
|
ansible.builtin.find:
|
2021-06-17 02:49:01 +00:00
|
|
|
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
|
2023-05-04 03:27:03 +00:00
|
|
|
ansible.builtin.file:
|
2021-06-17 02:49:01 +00:00
|
|
|
src: "{{ item.files[0].path }}"
|
|
|
|
dest: "{{ minecraft_home }}/{{ item.item.name }}/minecraft_server.jar"
|
2021-06-22 02:36:35 +00:00
|
|
|
owner: "{{ minecraft_user }}"
|
|
|
|
group: "{{ minecraft_user }}"
|
2021-06-17 02:49:01 +00:00
|
|
|
state: link
|
|
|
|
loop: "{{ minecraft_forge.results }}"
|
|
|
|
when: minecraft_forge is defined and item.files[0].path is defined
|