Hello Team,

We have a situation where we have to run same script on all 3 machines but 
in specific order like first it should be run on follower and then on 
leader.

now to achieve this i have to repeat same task  again with different 
condition. Can it be achieve in one ???


 - name: Kill running java processes and start newly configured systemd

    throttle: 1

#    ignore_errors: yes

    any_errors_fatal: true

    shell: '/bin/bash /tmp/zkcheck.sh'

    register: zkstart

    failed_when: zkstart.rc != 0

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


  - name: As all followers are up now repeat kill running java cp and start 
for leader

    any_errors_fatal: true

    shell: '/bin/bash /tmp/zkcheck.sh'

    register: zkstart

    failed_when: zkstart.rc != 0

    when: 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/80a84c53-2700-4807-afa9-45458969e395n%40googlegroups.com.

Reply via email to