restart service, check if service is ready to accept connection because it 
takes time to come up. Once we sure its listening on port then only move to 
next host. unless dont move because we can only afford to have one service 
down at a time.

is there any to short hand or ansible native way to handle this using 
ansible module.


code:

name: Restart zookeeper followers

  throttle: 1

  any_errors_fatal: true

  shell: |

     systemctl restart {{zookeeper_service_name}}  

     timeout 22 sh -c 'until nc localhost {{zookeeper_server_port}}; do 
sleep 1; done'

  when: not zkmode.stdout_lines is search('leader')



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/67ca5f13-855d-4d40-a47a-c0fbe11ea3b5n%40googlegroups.com.

Reply via email to