blob: d78aa6ecedcfd32d36e7b98d9fce098a63a4168b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# minecraft ~~ tasks/main.yml
---
- name: create minecraft group
group:
name: "{{ minecraft_group }}"
state: present
- name: create minecraft user
user:
name: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
system: true
- name: create minecraft directory
file:
path: "{{ minecraft_dir }}"
owner: "{{ minecraft_user }}"
group: "{{ minecraft_user }}"
mode: 0700
state: directory
- name: download minecraft server
get_url:
url: "{{ minecraft_url }}"
dest: "{{ minecraft_dir }}/{{ minecraft_bin }}"
owner: "{{ minecraft_user }}"
mode: 0644
- name: enable eula
lineinfile:
path: "{{ minecraft_dir }}/eula.txt"
regexp: "^eula=false"
line: eula=true
owner: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
mode: 0600
create: true
- name: create service minecraft server
include_role: name=rc
vars:
rc_cmd: java
rc_args: "-Xms{{ minecraft_ram }} -Xmx{{ minecraft_ram }} -XX:+UseG1GC -jar server.jar nogui"
rc_user: "{{ minecraft_user }}:{{ minecraft_group }}"
rc_dir: "{{ minecraft_dir }}"
rc_name: minecraft
rc_strictpexp: true
|