<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def post_task(task_data, task_uri='/tasks'):
 """Create Spinnaker Task. Args: task_data (str):
 Task JSON definition. Returns: str: Spinnaker Task ID. Raises: AssertionError: Error response from Spinnaker. """

    url = '{}/{}'.format(API_URL, task_uri.lstrip('/'))

    if isinstance(task_data, str):
        task_json = task_data
    else:
        task_json = json.dumps(task_data)

    resp = requests.post(url, data=task_json, headers=HEADERS, verify=GATE_CA_BUNDLE, cert=GATE_CLIENT_CERT)
    resp_json = resp.json()

    LOG.debug(resp_json)

    assert resp.ok, 'Spinnaker communication error: {0}'.format(resp.text)

    return resp_json['ref']