def METHOD_NAME(connection_port, credential=None):
    """Get the Ansible host vars that implement a credential.
    :param connection_port: The connection port
    :param credential: The credential used for connections
    :returns: a dict that can be used as the host variables in an
        Ansible inventory.
    """
    ansible_vars = {"ansible_port": connection_port}
    if credential is not None:
        ansible_dict = _credential_vars(credential)
        ansible_vars.update(ansible_dict)
    return ansible_vars