--- - name: "Search {{ awx_rest_api_type }} informations for {{ awx_search_name }} on awx server" uri: url: "{{ awx_base_url }}/api/v2/{{ awx_rest_api_type }}/?search={{ awx_search_name | urlencode }}" method: GET user: "{{ awx_rest_api_access_user }}" password: "{{ awx_rest_api_access_pw }}" return_content: true validate_certs: false force_basic_auth: yes status_code: 200 no_log: true register: awx_type_info tags: - awx_communication - name: "Get {{ awx_rest_api_type }} id for {{ awx_search_name }} on awx server" vars: query: '[? {{ awx_search_key }}==`{{ awx_search_name }}`].id' set_fact: awx_type_id: "{{ item.results | json_query(query) | first }}" when: (item.results is defined) and (item.results | length > 0) loop: - "{{ awx_type_info['content'] }}" no_log: true tags: - awx_communication