From 3e891b1a1fe21c26e7a09293106bf60dea6334e5 Mon Sep 17 00:00:00 2001 From: binary Date: Thu, 19 Nov 2020 23:40:34 +0100 Subject: Basic behyve initialization --- roles/minecraft/tasks/main.yml | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'roles/minecraft') 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 }}" - -- cgit v1.2.3