author | Luke Hoersten <luke@hoersten.org> |
Tue, 09 Jun 2020 14:39:54 -0500 | |
changeset 38 | b4e705f4cda4 |
parent 33 | ad75fc2d2853 |
child 42 | edb53dfadfb5 |
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}}" |
|
46 |
mode: "0755" |
|
47 |
||
48 |
- name: set world files |
|
49 |
become: yes |
|
50 |
lineinfile: |
|
51 |
path: "{{papermc_dir}}/bukkit.yml" |
|
52 |
regexp: "^ world-container:" |
|
53 |
line: " world-container: {{papermc_world_dir}}" |
|
54 |
insertbefore: "^ permissions-file:" |
|
55 |
notify: restart papermc |
|
19 | 56 |
|
57 |
- name: install systemd service |
|
58 |
become: yes |
|
59 |
template: |
|
33 | 60 |
src: "papermc.service.j2" |
61 |
dest: "/lib/systemd/system/papermc.service" |
|
62 |
notify: restart papermc |
|
19 | 63 |
|
64 |
- name: ensure service is started |
|
65 |
become: yes |
|
33 | 66 |
systemd: name="papermc.service" enabled="yes" state="started" |