def _extract_error_from_ansible_stderr(stderr: str):
    """
    Extract ansible error message from ansible stderr log

    >>> this = _extract_error_from_ansible_stderr
    >>> this('''
    ... [WARNING]: conditional statements should not include jinja2 templating
    ... [DEPRECATION WARNING]: Use errors="ignore" instead of skip. This feature will
    ... ''')
    ''
    >>> this('''
    ... [WARNING]: conditional statements should not include jinja2 templating
    ... ERROR! the role 'monitoring' was not found
    ...  include_role:
    ...    name: monitoring
    ...          ^ here
    ... [DEPRECATION WARNING]: Use errors="ignore" instead of skip. This feature will
    ... ''')
    "ERROR! the role \'monitoring\' was not found\\n include_role:\\n   name: monitoring\\n         ^ here\\n"
    >>> this('''
    ... [WARNING]: conditional statements should not include jinja2 templating
    ... ERROR! the role 'monitoring' was not found
    ...  include_role:
    ...    name: monitoring
    ...          ^ here
    ... ''')
    "ERROR! the role \'monitoring\' was not found\\n include_role:\\n   name: monitoring\\n         ^ here"
    """
    err_start = stderr.find("ERROR!")
    if err_start > -1:
        err_end = stderr.rfind("[", err_start)
        return stderr[err_start:err_end]
    return ""