def create_ipaddress(ip_address, family, device=None, interface=None):
    '''
    .. versionadded:: 2019.2.0

    Add an IP address, and optionally attach it to an interface.

    ip_address
        The IP address and CIDR, e.g., ``192.168.1.1/24``
    family
        Integer of IP family, e.g., ``4``
    device
        The name of the device to attach IP to, e.g., ``edge_router``
    interface
        The name of the interface to attach IP to, e.g., ``ae13``

    CLI Example:

    .. code-block:: bash

        salt myminion netbox.create_ipaddress 192.168.1.1/24 4 device=edge_router interface=ae13
    '''
    nb_addr = None
    payload = {'family': family, 'address': ip_address}
    if interface and device:
        nb_device = get_('dcim', 'devices', name=device)
        if not nb_device:
            return False
        nb_interface = get_('dcim', 'interfaces', device_id=nb_device['id'], name=interface)
        if not nb_interface:
            return False
        nb_addr = get_('ipam', 'ip-addresses', q=ip_address, interface_id=nb_interface['id'], family=family)
        if nb_addr:
            log.error(nb_addr)
            return False
        else:
            payload['interface'] = nb_interface['id']
    ipaddr = _add('ipam', 'ip-addresses', payload)
    if ipaddr:
        return {'ipam': {'ip-addresses': payload}}
    else:
        return ipaddr