Schedule minecraft server shutdown and startup
This commit is contained in:
parent
369551f824
commit
19fd7afbad
1 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue