add restart handler
This commit is contained in:
parent
ef5406bfac
commit
354f399b11
|
@ -1,3 +1,3 @@
|
||||||
mc_server_version: 15c777e2cfe0556eef19aab534b186c0c6f277e1
|
mc_server_version: 15c777e2cfe0556eef19aab534b186c0c6f277e1
|
||||||
mc_server_memory: 1G
|
mc_server_memory: 1000M
|
||||||
mc_server_ops: []
|
mc_server_ops: []
|
|
@ -0,0 +1,5 @@
|
||||||
|
- name: Restart server
|
||||||
|
systemd:
|
||||||
|
name: minecraft-server
|
||||||
|
daemon_reload: yes
|
||||||
|
state: restarted
|
|
@ -24,6 +24,7 @@
|
||||||
get_url:
|
get_url:
|
||||||
url: https://piston-data.mojang.com/v1/objects/{{ mc_server_version }}/server.jar
|
url: https://piston-data.mojang.com/v1/objects/{{ mc_server_version }}/server.jar
|
||||||
dest: /srv/minecraft-server
|
dest: /srv/minecraft-server
|
||||||
|
notify: Restart server
|
||||||
|
|
||||||
- name: Accept EULA
|
- name: Accept EULA
|
||||||
copy:
|
copy:
|
||||||
|
@ -34,21 +35,23 @@
|
||||||
copy:
|
copy:
|
||||||
content: "{{ mc_server_ops }}"
|
content: "{{ mc_server_ops }}"
|
||||||
dest: /srv/minecraft-server/ops.json
|
dest: /srv/minecraft-server/ops.json
|
||||||
|
notify: Restart server
|
||||||
|
|
||||||
- name: Install server script
|
- name: Install server script
|
||||||
template:
|
template:
|
||||||
src: minecraft-server.sh
|
src: minecraft-server.sh
|
||||||
dest: /srv/minecraft-server/minecraft-server.sh
|
dest: /srv/minecraft-server/minecraft-server.sh
|
||||||
|
notify: Restart server
|
||||||
|
|
||||||
- name: Install minecraft-server systemd unit
|
- name: Install minecraft-server systemd unit
|
||||||
copy:
|
copy:
|
||||||
src: minecraft-server.service
|
src: minecraft-server.service
|
||||||
dest: /etc/systemd/system/minecraft-server.service
|
dest: /etc/systemd/system/minecraft-server.service
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
notify: Restart server
|
||||||
|
|
||||||
- name: Enable minecraft-server service
|
- name: Enable minecraft-server service
|
||||||
systemd:
|
systemd:
|
||||||
name: minecraft-server
|
name: minecraft-server
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
state: started
|
|
||||||
enabled: yes
|
enabled: yes
|
Loading…
Reference in New Issue