def test_action_run_ansible_playbook_localhost(request, ansible_catalog_item, ansible_action,
        policy_for_testing, full_template_vm_modscope, ansible_credential, service_request,
        service):
    """Tests a policy with ansible playbook action against localhost.

    Polarion:
        assignee: sbulage
        initialEstimate: 1/6h
        casecomponent: Ansible
    """
    with update(ansible_action):
        ansible_action.run_ansible_playbook = {"inventory": {"localhost": True}}
    added_tag = full_template_vm_modscope.add_tag()
    request.addfinalizer(lambda: full_template_vm_modscope.remove_tag(added_tag))
    wait_for(service_request.exists, num_sec=600)
    service_request.wait_for_request()
    view = navigate_to(service, "Details")
    assert view.provisioning.details.get_text_of("Hosts") == "localhost"
    assert view.provisioning.results.get_text_of("Status") == "successful"