ansible-automation/scripts/diagnose_agent.sh
2026-03-01 01:23:41 -07:00

8 lines
394 B
Bash

#!/bin/bash
# Diagnose Portainer Agent status on ubuntu-server-02
ansible ubuntu-server-02 -i inventory/hosts.yml \
-m shell \
-a "docker logs portainer_agent 2>&1 | tail -30; echo '=== INSPECT ==='; docker inspect portainer_agent --format '{{.State.Status}} restarts={{.RestartCount}}' 2>&1; echo '=== DOCKER ROOT ==='; docker info 2>/dev/null | grep 'Docker Root Dir'" \
--become 2>&1