title: Ansible Role to Check Health of a host group
body: <p>After running several plays in my playbook, I want to verify the deployment of my apps.</p>
  
  <p>In one of my roles, I have the following task, adds created ec2 instances to hosts as 'launched':</p>
  
  <pre><code>- name: Add new instance to host group
    local_action: add_host hostname={{ item.public_ip }} groupname=launched
    with_items: ec2.instances
  </code></pre>
  
  <p>Here is my main playbook, <code>site.yml</code> :</p>
  
  <pre><code>......
  Run some plays for deployment and provisioning
  ......
  # Validate the deployment by reaching from the local machine
  - hosts: localhost
    connection: local
    roles:
    - validate_deployment
  </code></pre>
  
  <p>Here is my <code>verify_deployment/tasks/main.yml</code></p>
  
  <pre><code>- name: Validate the deployment. Launched is my dynamically created host group
    uri: url="https://{{ inventory_hostname }}:8000"
    with_items: launched 
  </code></pre>
  
  <p>What am I doing wrong?</p>