Collect logs for containers only if docker runs
If no docker service runs on the host, but docker is installed, docker stats command hangs forever. Prevent running all docker commands if no docker service is running. Change-Id: I697ed2bde251513ece0a25f7d2b51074f11e9c3e
This commit is contained in:
parent
a6c5c46c81
commit
3d990bebfd
|
@ -137,7 +137,7 @@
|
|||
|
||||
- name: Collect docker info and logs
|
||||
shell: >
|
||||
if command -v docker; then
|
||||
if command -v docker && systemctl is-active docker; then
|
||||
All_FILE=/var/log/extra/docker_allinfo.log;
|
||||
docker ps --all --size &> $All_FILE;
|
||||
docker images &>> $All_FILE;
|
||||
|
|
Loading…
Reference in New Issue