Hi,
I wrote a module to loop on a command until you get an expected result.
This is useful when you don’t want your playbook to continue until for ex your Solr warmup is done and you engine is ready to take request.
Basically, it works like this :
- name: wait for solrwarmup
local_action : kk_wait_for_result command=‘wget -O - “http://{{ ansible_fqdn }}:{{ port }}/searchsolrnode{{ country }}/{{ country}}/select?q=:&rows=0”’ result=“numFound” delay=30 timeout=600
It is written in Python with all the requirement to be added into Ansible core.
Would you be interested in adding it?
Thanks,
Ludo
PS : Here is the code of the module
#!/usr/bin/python
-- coding: utf-8 --
import datetime
import time
import sys
DOCUMENTATION = ‘’’