disable/enable minecraft instances
This commit is contained in:
parent
22dbc01a3c
commit
4dd6380c0b
@ -86,8 +86,8 @@
|
|||||||
- name: manage minecraft service
|
- name: manage minecraft service
|
||||||
service:
|
service:
|
||||||
name: "minecraft@{{ item.name }}"
|
name: "minecraft@{{ item.name }}"
|
||||||
state: "{{ minecraft_service_state }}"
|
state: "{{ item.state | default(minecraft_service_state) }}"
|
||||||
enabled: "{{ minecraft_service_enabled }}"
|
enabled: "{{ item.enabled | default(minecraft_service_enabled) }}"
|
||||||
loop: "{{ minecraft_worlds }}"
|
loop: "{{ minecraft_worlds }}"
|
||||||
|
|
||||||
#- name: configure ops
|
#- name: configure ops
|
||||||
|
@ -47,6 +47,11 @@ start_server() {
|
|||||||
local unit="${1:-$SERVICE}"
|
local unit="${1:-$SERVICE}"
|
||||||
local attempts="${2:-$WAIT}"
|
local attempts="${2:-$WAIT}"
|
||||||
|
|
||||||
|
if ! systemctl -q is-enabled "$unit"; then
|
||||||
|
printf "%s is not enabled, skipping.\n" "$unit"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if systemctl -q is-active "$unit"; then
|
if systemctl -q is-active "$unit"; then
|
||||||
printf "%s is already started\n" "$unit"
|
printf "%s is already started\n" "$unit"
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user