Fix check docker script to run only on manager nodes
This commit is contained in:
parent
26bf4a2096
commit
3ae7fcf67e
@ -1,5 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
docker node ls
|
||||||
|
if [ $? == 1 ]; then
|
||||||
|
echo "This is not a docker swarm node exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
docker node inspect {{ ansible_hostname }} --format "{{ '{{' }} .Status.State {{ '}}' }}" | grep -q 'ready'
|
docker node inspect {{ ansible_hostname }} --format "{{ '{{' }} .Status.State {{ '}}' }}" | grep -q 'ready'
|
||||||
|
|
||||||
if [ $? == 1 ]; then
|
if [ $? == 1 ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user