My Playbook:
---------------------------
- hosts: web
vars:
increaseCount: 0
remote_user: root
tasks:
- name: Verifying HTTP endpoint
uri:
url: "http://{{inventory_hostname}}:{{httpd_port}}/Test"
method: PUT
body: "{{ lookup('file',test.json') }}"
status_code: 200
body_format: json
return_content: yes
register: http_verify_out
failed_when: http_verify_out.status != 200
My scenario:
I am using ansible 2.0.1
In playbook hosts: web will be having multiple hosts.
If one host is executed the task successfully i want to skip the other hosts to execute the tasks.
Is there away to achieve this ?. If yes please let me know the solution
Thanks in advance :)