Schedule minecraft server shutdown and startup

This commit is contained in:
Ivan R. 2024-12-11 20:07:24 +05:00
parent 369551f824
commit 19fd7afbad
Signed by: lumin
GPG key ID: E0937DC7CD6D3817

View file

@ -29,3 +29,19 @@
start_period: 2m
retries: 2
restart_policy: unless-stopped
- name: Set up shutdown job
become: true
ansible.builtin.cron:
name: minecraft-shutdown
hour: "0"
minute: "0"
job: "docker stop --time 60 minecraft"
user: root
- name: Set up startup job
become: true
ansible.builtin.cron:
name: minecraft-startup
hour: "9"
minute: "0"
job: "docker start minecraft"
user: root