salt stack - How do I make saltstack wait for 200 OK? -
i have following state:
healthy:   cmd.run:     - name: echo 'true'     - onlyif: "curl -i http://127.0.0.1:{{ port }} 2>/dev/null | head -n 1 | awk '$2 ~ /200/ { print \"true\" }"     - require:       - docker: running the problem checks once , exits, how make waits timeout until gets 200 otherwise exits?
while $(curl -i http://localhost:8080/ 2> /dev/null | awk '/200 ok/  { exit 1 }');  count=$(expr $count + 1); sleep 1; [ "$count" -ge "60" ] && exit 1; done 
Comments
Post a Comment