# HG changeset patch # User Luke Hoersten # Date 1593633098 18000 # Node ID 9057b9f9ced8255ae0c6424f50c90a878e9aecb4 # Parent 50f9047e2439c078b3f30512893109ac038337b1 MC separate world files dont work. Had to move main dir. diff -r 50f9047e2439 -r 9057b9f9ced8 papermc/defaults/main.yaml --- a/papermc/defaults/main.yaml Wed Jul 01 13:24:46 2020 -0500 +++ b/papermc/defaults/main.yaml Wed Jul 01 14:51:38 2020 -0500 @@ -7,4 +7,4 @@ papermc_dir: "/opt/papermc" papermc_motd: "A Minecraft Server" papermc_mem: "2G" -papermc_world_dir: "{{papermc_dir}}" +papermc_seed: "" diff -r 50f9047e2439 -r 9057b9f9ced8 papermc/tasks/main.yaml --- a/papermc/tasks/main.yaml Wed Jul 01 13:24:46 2020 -0500 +++ b/papermc/tasks/main.yaml Wed Jul 01 14:51:38 2020 -0500 @@ -28,31 +28,24 @@ - "ops.json" notify: restart papermc -- name: set motd +- name: create server.properties + become: yes + file: + path: "{{papermc_dir}}/server.properties" + state: "touch" + owner: "{{papermc_user}}" + group: "{{papermc_user}}" + +- name: configure server.properties become: yes lineinfile: path: "{{papermc_dir}}/server.properties" - regexp: "^motd=" - line: "motd={{papermc_motd}}" + regexp: "^{{item.key}}=" + line: "{{item.key}}={{item.value}}" notify: restart papermc - -- name: create world file directory - become: yes - file: - path: "{{papermc_world_dir}}" - state: "directory" - owner: "{{papermc_user}}" - group: "{{papermc_user}}" - mode: "0755" - -- name: set world files - become: yes - lineinfile: - path: "{{papermc_dir}}/bukkit.yml" - regexp: "^ world-container:" - line: " world-container: {{papermc_world_dir}}" - insertbefore: "^ permissions-file:" - notify: restart papermc + loop: + - {key: "motd", value: "{{papermc_motd}}"} + - {key: "level-seed", value: "{{papermc_seed}}"} - name: install systemd service become: yes