diff options
Diffstat (limited to 'roles/minecraft/tasks/main.yml')
-rw-r--r-- | roles/minecraft/tasks/main.yml | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/roles/minecraft/tasks/main.yml b/roles/minecraft/tasks/main.yml index 56a9eed..bbb6202 100644 --- a/roles/minecraft/tasks/main.yml +++ b/roles/minecraft/tasks/main.yml @@ -3,39 +3,26 @@ --- -- name: Check java installation - package: - name: openjdk11-jre - state: present - -- name: Create minecraft user +- name: create minecraft user user: name: "{{ minecraft_user }}" group: "{{ minecraft_user }}" -- name: Create minecraft directory +- name: create minecraft directory file: path: "{{ minecraft_dir }}" owner: "{{ minecraft_user }}" group: "{{ minecraft_user }}" state: directory -- name: Download minecraft server +- name: download minecraft server get_url: url: "{{ minecraft_url }}" dest: "{{ minecraft_dir }}/{{ minecraft_bin }}" owner: "{{ minecraft_user }}" -- name: Enable eula +- name: enable eula + shell: echo "eula=true" >> eula.txt + chdir: "{{ minecraft_dir }}" + become: true become_user: "{{ minecraft_user }}" - shell: echo "eula=true" >> {{ minecraft_dir}}/eula.txt - -- name: Create rc script - include_role: - name: rc - vars: - rc_name: "minecraft" - rc_cmd: "/usr/bin/java" - rc_args: "-jar {{ minecraft_dir }}/{{ minecraft_bin }}" - rc_user: "{{ minecraft_user }}" - |