author | Luke Hoersten <luke@hoersten.org> |
Wed, 01 Jul 2020 14:51:38 -0500 | |
changeset 107 | 9057b9f9ced8 |
parent 59 | b339d3c51504 |
child 111 | 1c1a911b26aa |
permissions | -rw-r--r-- |
19 | 1 |
--- |
2 |
||
33 | 3 |
- name: add papermc user |
19 | 4 |
become: yes |
33 | 5 |
user: name="{{papermc_user}}" home="{{papermc_dir}}" |
19 | 6 |
|
7 |
- name: install jre |
|
8 |
become: yes |
|
9 |
apt: name="default-jre-headless" |
|
10 |
||
33 | 11 |
- name: download papermc |
19 | 12 |
become: yes |
13 |
get_url: |
|
33 | 14 |
url: "{{papermc_url}}" |
15 |
dest: "{{papermc_dir}}/server.jar" |
|
19 | 16 |
mode: "0755" |
33 | 17 |
notify: restart papermc |
19 | 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}}" |
33 | 23 |
dest: "{{papermc_dir}}/{{item}}" |
24 |
owner: "{{papermc_user}}" |
|
25 |
group: "{{papermc_user}}" |
|
20
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" |
33 | 29 |
notify: restart papermc |
19 | 30 |
|
107
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
31 |
- name: create server.properties |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
32 |
become: yes |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
33 |
file: |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
34 |
path: "{{papermc_dir}}/server.properties" |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
35 |
state: "touch" |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
36 |
owner: "{{papermc_user}}" |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
37 |
group: "{{papermc_user}}" |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
38 |
|
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
39 |
- name: configure server.properties |
33 | 40 |
become: yes |
41 |
lineinfile: |
|
42 |
path: "{{papermc_dir}}/server.properties" |
|
107
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
43 |
regexp: "^{{item.key}}=" |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
44 |
line: "{{item.key}}={{item.value}}" |
33 | 45 |
notify: restart papermc |
107
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
46 |
loop: |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
47 |
- {key: "motd", value: "{{papermc_motd}}"} |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
48 |
- {key: "level-seed", value: "{{papermc_seed}}"} |
19 | 49 |
|
50 |
- name: install systemd service |
|
51 |
become: yes |
|
52 |
template: |
|
33 | 53 |
src: "papermc.service.j2" |
54 |
dest: "/lib/systemd/system/papermc.service" |
|
55 |
notify: restart papermc |
|
19 | 56 |
|
57 |
- name: ensure service is started |
|
58 |
become: yes |
|
33 | 59 |
systemd: name="papermc.service" enabled="yes" state="started" |