diff --git a/examples/016_tasks_handlers/playbooks/stack_status.yml b/examples/016_tasks_handlers/playbooks/stack_status.yml index 9effbd5..f77d573 100644 --- a/examples/016_tasks_handlers/playbooks/stack_status.yml +++ b/examples/016_tasks_handlers/playbooks/stack_status.yml @@ -26,6 +26,26 @@ - name: verify mysql is listening on 3306 wait_for: port=3306 timeout=1 +- hosts: loadbalancer + tasks: + - name: verify backend index response + uri: url=http://{{item}} return_content=yes + loop: "{{ groups.webserver }}" + register: app_index + + - fail: msg="index failed to return content" + when: "'Hello, from sunny {{item.item}}!' not in item.content" + loop: "{{app_index.results}}" + + - name: verify backend db response + uri: url=http://{{item}}/db return_content=yes + loop: "{{ groups.webserver }}" + register: app_db + + - fail: msg="db failed to return content" + when: "'Database Connected from {{item.item}}!' not in item.content" + loop: "{{app_db.results}}" + - hosts: control tasks: - name: get elements from loadbalancer group @@ -47,24 +67,4 @@ - fail: msg="db failed to return content" when: "'Database Connected from' not in item.content" - loop: "{{lb_db.results}}" - -- hosts: loadbalancer - tasks: - - name: verify backend index response - uri: url=http://{{item}} return_content=yes - loop: "{{ groups.webserver }}" - register: app_index - - - fail: msg="index failed to return content" - when: "'Hello, from sunny {{item.item}}!' not in item.content" - loop: "{{app_index.results}}" - - - name: verify backend db response - uri: url=http://{{item}}/db return_content=yes - loop: "{{ groups.webserver }}" - register: app_db - - - fail: msg="db failed to return content" - when: "'Database Connected from {{item.item}}!' not in item.content" - loop: "{{app_db.results}}" \ No newline at end of file + loop: "{{lb_db.results}}" \ No newline at end of file