author | Luke Hoersten <luke@hoersten.org> |
Wed, 13 May 2020 09:24:18 -0500 | |
changeset 20 | 9cacee5eec83 |
parent 19 | 31de177274a1 |
child 27 | 8fddefdd948b |
permissions | -rw-r--r-- |
19 | 1 |
--- |
2 |
||
3 |
- name: add minecract user |
|
4 |
become: yes |
|
5 |
user: name="{{minecraft_user}}" home="{{minecraft_dir}}" |
|
6 |
||
7 |
- name: install jre |
|
8 |
become: yes |
|
9 |
apt: name="default-jre-headless" |
|
10 |
||
11 |
- name: download minecraft |
|
12 |
become: yes |
|
13 |
get_url: |
|
14 |
url: "{{minecraft_url}}" |
|
15 |
dest: "{{minecraft_dir}}/server.jar" |
|
16 |
mode: "0755" |
|
17 |
notify: restart minecraft |
|
18 |
||
20
9cacee5eec83
Added ops to minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
19
diff
changeset
|
19 |
- name: configure eula and ops |
19 | 20 |
become: yes |
21 |
copy: |
|
20
9cacee5eec83
Added ops to minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
19
diff
changeset
|
22 |
src: "{{item}}" |
9cacee5eec83
Added ops to minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
19
diff
changeset
|
23 |
dest: "{{minecraft_dir}}/{{item}}" |
9cacee5eec83
Added ops to minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
19
diff
changeset
|
24 |
owner: "{{minecraft_user}}" |
9cacee5eec83
Added ops to minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
19
diff
changeset
|
25 |
group: "{{minecraft_user}}" |
9cacee5eec83
Added ops to minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
19
diff
changeset
|
26 |
loop: |
9cacee5eec83
Added ops to minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
19
diff
changeset
|
27 |
- "eula.txt" |
9cacee5eec83
Added ops to minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
19
diff
changeset
|
28 |
- "ops.json" |
19 | 29 |
|
30 |
- name: configure minecraft |
|
31 |
become: yes |
|
32 |
template: |
|
33 |
src: "server.properties.j2" |
|
34 |
dest: "{{minecraft_dir}}/server.properties" |
|
35 |
owner: "{{minecraft_user}}" |
|
36 |
group: "{{minecraft_user}}" |
|
37 |
notify: restart minecraft |
|
38 |
||
39 |
- name: install systemd service |
|
40 |
become: yes |
|
41 |
template: |
|
42 |
src: "minecraft.service.j2" |
|
43 |
dest: "/lib/systemd/system/minecraft.service" |
|
44 |
||
45 |
- name: ensure service is started |
|
46 |
become: yes |
|
47 |
systemd: name="minecraft.service" enabled="yes" state="started" |