26 loop: |
26 loop: |
27 - "eula.txt" |
27 - "eula.txt" |
28 - "ops.json" |
28 - "ops.json" |
29 notify: restart papermc |
29 notify: restart papermc |
30 |
30 |
31 - name: set motd |
31 - name: create server.properties |
|
32 become: yes |
|
33 file: |
|
34 path: "{{papermc_dir}}/server.properties" |
|
35 state: "touch" |
|
36 owner: "{{papermc_user}}" |
|
37 group: "{{papermc_user}}" |
|
38 |
|
39 - name: configure server.properties |
32 become: yes |
40 become: yes |
33 lineinfile: |
41 lineinfile: |
34 path: "{{papermc_dir}}/server.properties" |
42 path: "{{papermc_dir}}/server.properties" |
35 regexp: "^motd=" |
43 regexp: "^{{item.key}}=" |
36 line: "motd={{papermc_motd}}" |
44 line: "{{item.key}}={{item.value}}" |
37 notify: restart papermc |
45 notify: restart papermc |
38 |
46 loop: |
39 - name: create world file directory |
47 - {key: "motd", value: "{{papermc_motd}}"} |
40 become: yes |
48 - {key: "level-seed", value: "{{papermc_seed}}"} |
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 |
|
56 |
49 |
57 - name: install systemd service |
50 - name: install systemd service |
58 become: yes |
51 become: yes |
59 template: |
52 template: |
60 src: "papermc.service.j2" |
53 src: "papermc.service.j2" |