---
- name: Fetch list of inventory hosts from Tower
  uri:
    force_basic_auth : yes
    url_username     : "{{ __tower_user}}"
    url_password     : "{{ __tower_pass}}"
    url              : "{{ __tower_url }}/api/v2/inventories/\
                        {{ r_inv_id.id | default(r_inventory.json.id) }}/hosts/\
                        ?page_size={{ __api_results | default('20') }}"
    validate_certs   : no
    return_content   : no
    body_format      : json
  register           : r_get_inv_host_list


- name: Register inventory host list
  set_fact:
    r_twr_host_list: "{{ lookup('template', 'templates/host_list_w_group.j2') }}"


...
