author | Luke Hoersten <luke@hoersten.org> |
Mon, 25 Oct 2021 15:57:24 -0500 | |
changeset 176 | 2d705e63f6cb |
parent 174 | 431c6d5e5dd4 |
child 177 | 11f52d70bca4 |
permissions | -rw-r--r-- |
19 | 1 |
--- |
2 |
||
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
3 |
- name: add minecraft user |
19 | 4 |
become: yes |
174 | 5 |
user: name="{{minecraft_user}}" home="{{minecraft_parent_dir}}/minecraft" shell="/bin/false" system="yes" |
19 | 6 |
|
152
740231770c7c
Updated minecraft to 1.17.
Luke Hoersten <luke@hoersten.org>
parents:
125
diff
changeset
|
7 |
- name: install adoptopenjdk |
740231770c7c
Updated minecraft to 1.17.
Luke Hoersten <luke@hoersten.org>
parents:
125
diff
changeset
|
8 |
include_tasks: adoptopenjdk.yaml |
19 | 9 |
|
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
10 |
- name: create minecraft dir |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
11 |
become: yes |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
12 |
file: |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
13 |
path: "{{minecraft_dir}}" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
14 |
owner: "{{minecraft_user}}" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
15 |
group: "{{minecraft_user}}" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
16 |
mode: "0755" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
17 |
state: "directory" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
18 |
|
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
19 |
- name: download minecraft |
19 | 20 |
become: yes |
21 |
get_url: |
|
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
22 |
url: "{{minecraft_url}}" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
23 |
dest: "{{minecraft_dir}}/server.jar" |
19 | 24 |
mode: "0755" |
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
25 |
notify: restart minecraft |
19 | 26 |
|
155
4d45841961e7
Added ops template to main.
Luke Hoersten <luke@hoersten.org>
parents:
153
diff
changeset
|
27 |
- name: configure minecraft eula |
19 | 28 |
become: yes |
29 |
copy: |
|
163 | 30 |
src: "eula.txt" |
31 |
dest: "{{minecraft_dir}}/eula.txt" |
|
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
32 |
owner: "{{minecraft_user}}" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
33 |
group: "{{minecraft_user}}" |
155
4d45841961e7
Added ops template to main.
Luke Hoersten <luke@hoersten.org>
parents:
153
diff
changeset
|
34 |
notify: restart minecraft |
4d45841961e7
Added ops template to main.
Luke Hoersten <luke@hoersten.org>
parents:
153
diff
changeset
|
35 |
|
4d45841961e7
Added ops template to main.
Luke Hoersten <luke@hoersten.org>
parents:
153
diff
changeset
|
36 |
- name: configure minecraft ops |
4d45841961e7
Added ops template to main.
Luke Hoersten <luke@hoersten.org>
parents:
153
diff
changeset
|
37 |
become: yes |
163 | 38 |
copy: |
39 |
src: "{{minecraft_ops_file}}" |
|
155
4d45841961e7
Added ops template to main.
Luke Hoersten <luke@hoersten.org>
parents:
153
diff
changeset
|
40 |
dest: "{{minecraft_dir}}/ops.json" |
4d45841961e7
Added ops template to main.
Luke Hoersten <luke@hoersten.org>
parents:
153
diff
changeset
|
41 |
owner: "{{minecraft_user}}" |
4d45841961e7
Added ops template to main.
Luke Hoersten <luke@hoersten.org>
parents:
153
diff
changeset
|
42 |
group: "{{minecraft_user}}" |
163 | 43 |
when: minecraft_ops_file is defined |
44 |
notify: restart minecraft |
|
45 |
||
46 |
- name: configure minecraft whitelist |
|
47 |
become: yes |
|
48 |
copy: |
|
49 |
src: "{{minecraft_whitelist_file}}" |
|
50 |
dest: "{{minecraft_dir}}/whitelist.json" |
|
51 |
owner: "{{minecraft_user}}" |
|
52 |
group: "{{minecraft_user}}" |
|
53 |
when: minecraft_whitelist_file is defined and minecraft_whitelist == "true" |
|
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
54 |
notify: restart minecraft |
19 | 55 |
|
162
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
56 |
- name: create minecraft plugins dir |
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
57 |
become: yes |
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
58 |
file: |
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
59 |
path: "{{minecraft_dir}}/plugins" |
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
60 |
owner: "{{minecraft_user}}" |
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
61 |
group: "{{minecraft_user}}" |
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
62 |
mode: "0755" |
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
63 |
state: "directory" |
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
64 |
|
125
5a298f7b44f5
Added dynmap to minecraft.
Luke Hoersten <luke@hoersten.org>
parents:
112
diff
changeset
|
65 |
- name: install plugins |
162
a7a64ed07204
Added Geyser minecraft plugin. Cleaned up minecraft role.
Luke Hoersten <luke@hoersten.org>
parents:
156
diff
changeset
|
66 |
include_tasks: "{{item}}.yaml" |
164
ae19501f5251
Updated minecraft to be multi-world and minimized world size.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
67 |
loop: "{{minecreat_plugins_enabled}}" |
125
5a298f7b44f5
Added dynmap to minecraft.
Luke Hoersten <luke@hoersten.org>
parents:
112
diff
changeset
|
68 |
|
107
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
69 |
- 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
|
70 |
become: yes |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
71 |
file: |
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
72 |
path: "{{minecraft_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
|
73 |
state: "touch" |
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
74 |
access_time: "preserve" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
75 |
modification_time: "preserve" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
76 |
owner: "{{minecraft_user}}" |
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
77 |
group: "{{minecraft_user}}" |
107
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
78 |
|
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
79 |
- name: configure server.properties |
33 | 80 |
become: yes |
81 |
lineinfile: |
|
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
82 |
path: "{{minecraft_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
|
83 |
regexp: "^{{item.key}}=" |
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
84 |
line: "{{item.key}}={{item.value}}" |
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
85 |
notify: restart minecraft |
107
9057b9f9ced8
MC separate world files dont work. Had to move main dir.
Luke Hoersten <luke@hoersten.org>
parents:
59
diff
changeset
|
86 |
loop: |
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
87 |
- {key: "motd", value: "{{minecraft_motd}}"} |
164
ae19501f5251
Updated minecraft to be multi-world and minimized world size.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
88 |
- {key: "level-name", value: "{{minecraft_world_name}}"} |
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
89 |
- {key: "level-seed", value: "{{minecraft_seed}}"} |
153 | 90 |
- {key: "difficulty", value: "{{minecraft_difficulty}}"} |
163 | 91 |
- {key: "white-list", value: "{{minecraft_whitelist}}"} |
92 |
- {key: "enforce-whitelist", value: "{{minecraft_whitelist}}"} |
|
93 |
- {key: "view-distance", value: "{{minecraft_view_distance}}"} |
|
94 |
- {key: "snooper-enabled", value: "false"} |
|
19 | 95 |
|
96 |
- name: install systemd service |
|
97 |
become: yes |
|
98 |
template: |
|
164
ae19501f5251
Updated minecraft to be multi-world and minimized world size.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
99 |
src: "[email protected]" |
ae19501f5251
Updated minecraft to be multi-world and minimized world size.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
100 |
dest: "/lib/systemd/system/[email protected]" |
111
1c1a911b26aa
Made minecraft role support vanilla and paper forks.
Luke Hoersten <luke@hoersten.org>
parents:
107
diff
changeset
|
101 |
notify: restart minecraft |
19 | 102 |
|
103 |
- name: ensure service is started |
|
104 |
become: yes |
|
164
ae19501f5251
Updated minecraft to be multi-world and minimized world size.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
105 |
systemd: name="minecraft@{{minecraft_world_name}}.service" enabled="yes" state="started" |