Create a new node if it does not already exist.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the node to create
    address
        The address of the node

def create_node(hostname, username, password, name, address):
    '''
    Create a new node if it does not already exist.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the node to create
    address
        The address of the node
    '''

    ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}

    if __opts__['test']:
        return _test_output(ret, 'create', params={
            'hostname': hostname,
            'username': username,
            'password': password,
            'name': name,
            'address': address
        }
        )

    #is this node currently configured?
    existing = __salt__['bigip.list_node'](hostname, username, password, name)

    # if it exists
    if existing['code'] == 200:

        ret['result'] = True
        ret['comment'] = 'A node by this name currently exists.  No change made.'

    # if it doesn't exist
    elif existing['code'] == 404:
        response = __salt__['bigip.create_node'](hostname, username, password, name, address)

        ret['result'] = True
        ret['changes']['old'] = {}
        ret['changes']['new'] = response['content']
        ret['comment'] = 'Node was successfully created.'

    # else something else was returned
    else:
        ret = _load_result(existing, ret)

    return ret