author | Luke Hoersten <luke@hoersten.org> |
Tue, 16 Jun 2020 10:54:40 -0500 | |
changeset 49 | 05924a38d51f |
parent 42 | edb53dfadfb5 |
child 59 | b339d3c51504 |
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 |
|
33 | 31 |
- name: set motd |
32 |
become: yes |
|
33 |
lineinfile: |
|
34 |
path: "{{papermc_dir}}/server.properties" |
|
35 |
regexp: "^motd=" |
|
36 |
line: "motd={{papermc_motd}}" |
|
37 |
notify: restart papermc |
|
38 |
||
39 |
- name: create world file directory |
|
19 | 40 |
become: yes |
33 | 41 |
file: |
42 |
path: "{{papermc_world_dir}}" |
|
43 |
state: "directory" |
|
44 |
owner: "{{papermc_user}}" |
|
45 |
group: "{{papermc_user}}" |
|
42
edb53dfadfb5
Moved to ext4 for permissions on hdd.
Luke Hoersten <luke@hoersten.org>
parents:
33
diff
changeset
|
46 |
recurse: "yes" |
33 | 47 |
mode: "0755" |
48 |
||
49 |
- name: set world files |
|
50 |
become: yes |
|
51 |
lineinfile: |
|
52 |
path: "{{papermc_dir}}/bukkit.yml" |
|
53 |
regexp: "^ world-container:" |
|
54 |
line: " world-container: {{papermc_world_dir}}" |
|
55 |
insertbefore: "^ permissions-file:" |
|
56 |
notify: restart papermc |
|
19 | 57 |
|
58 |
- name: install systemd service |
|
59 |
become: yes |
|
60 |
template: |
|
33 | 61 |
src: "papermc.service.j2" |
62 |
dest: "/lib/systemd/system/papermc.service" |
|
63 |
notify: restart papermc |
|
19 | 64 |
|
65 |
- name: ensure service is started |
|
66 |
become: yes |
|
33 | 67 |
systemd: name="papermc.service" enabled="yes" state="started" |