aboutsummaryrefslogtreecommitdiffstats
path: root/roles/minecraft/tasks
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-11-19 23:40:34 +0100
committerbinary <me@rgoncalves.se>2020-11-19 23:40:34 +0100
commit3e891b1a1fe21c26e7a09293106bf60dea6334e5 (patch)
treea29d9e192423a39f9e6720a6acdaa05a24b0676f /roles/minecraft/tasks
parentc7cca6eb560146116a57fb2a2bfff35c9ba023bc (diff)
downloadinfrastructure-3e891b1a1fe21c26e7a09293106bf60dea6334e5.tar.gz
Basic behyve initialization
Diffstat (limited to 'roles/minecraft/tasks')
-rw-r--r--roles/minecraft/tasks/main.yml27
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 }}"
-
remember that computers suck.