forked from jakub/ansible
fix: correct indentation for vm_commands and streamline container state check logic
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
collabora_url: "https://collabora.martinfencl.eu/"
|
collabora_url: "https://collabora.martinfencl.eu/"
|
||||||
collabora_discovery_url: "https://collabora.martinfencl.eu/hosting/discovery"
|
collabora_discovery_url: "https://collabora.martinfencl.eu/hosting/discovery"
|
||||||
|
|
||||||
vm_commands:
|
vm_commands:
|
||||||
- name: Run Nextcloud cron
|
- name: Run Nextcloud cron
|
||||||
command: >-
|
command: >-
|
||||||
docker exec -u www-data
|
docker exec -u www-data
|
||||||
@@ -52,11 +52,7 @@
|
|||||||
{{ nextcloud_db_container | quote }}
|
{{ nextcloud_db_container | quote }}
|
||||||
{{ redis_container | quote }};
|
{{ redis_container | quote }};
|
||||||
do
|
do
|
||||||
state="$(
|
state="$(docker inspect --format '{% raw %}{{.State.Running}}{% endraw %}' "${container}" 2>/dev/null)";
|
||||||
docker inspect
|
|
||||||
--format '{% raw %}{{.State.Running}}{% endraw %}'
|
|
||||||
"${container}" 2>/dev/null
|
|
||||||
)";
|
|
||||||
if [ "${state}" != "true" ]; then
|
if [ "${state}" != "true" ]; then
|
||||||
echo "Container ${container} is not running" >&2;
|
echo "Container ${container} is not running" >&2;
|
||||||
exit 1;
|
exit 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user