def alias_ip_address(ip_address, interface, aws=False):
    """Adds an IP alias to a specific interface

    Adds an ip address as an alias to the specified interface on
    Linux systems.

    :param ip_address: (str) IP address to set as an alias
    :param interface: (str) The interface number or full device name, if
        an int is provided assumes the device name is eth<i>
    :param aws (bool) True to perform additional AWS config
    :return: None
    """
    log = logging.getLogger(mod_logger + '.alias_ip_address')

    # Validate args
    if not isinstance(ip_address, basestring):
        msg = 'ip_address argument is not a string'
        log.error(msg)
        raise TypeError(msg)

    # Validate the IP address
    if not validate_ip_address(ip_address):
        msg = 'The provided IP address arg is invalid: {i}'.format(i=ip_address)
        log.error(msg)
        raise ValueError(msg)

    # Determine if the interface provided is a full device name
    try:
        int(interface)
    except ValueError:
        if isinstance(interface, basestring):
            device_name = str(interface)
            log.info('Full device name provided, will attempt to alias: {d}'.format(d=device_name))
        else:
            raise TypeError('Provided interface arg must be an int or str')
    else:
        device_name = 'eth{i}'.format(i=interface)
        log.info('Integer provided as interface, using device name: {d}'.format(d=device_name))

    # Add alias
    command = ['ifconfig', '{d}:0'.format(d=device_name), ip_address, 'up']
    log.info('Running command to bring up the alias: {c}'.format(c=' '.join(command)))
    try:
        result = run_command(command)
    except CommandError:
        _, ex, trace = sys.exc_info()
        log.warn('CommandError: There was a problem running command: {c}\n{e}'.format(
            c=' '.join(command), e=str(ex)))
    else:
        log.info('Command produced output:\n{o}'.format(o=result['output']))
        if int(result['code']) != 0:
            log.warn('ifconfig up command produced exit code: {c} and output:\n{o}'.format(
                c=result['code'], o=result['output']))
        else:
            log.info('ifconfig up exited successfully')

    # Create interface file from the existing file
    base_ifcfg = os.path.abspath(os.path.join(os.sep, 'etc', 'sysconfig', 'network-scripts', 'ifcfg-{d}'.format(
            d=device_name)))
    alias_ifcfg = base_ifcfg + ':0'
    log.info('Creating interface config file: {f}'.format(f=alias_ifcfg))

    # Ensure the base config file exists
    if not os.path.isfile(base_ifcfg):
        raise OSError('Required interface config file not found: {f}'.format(f=base_ifcfg))
    else:
        log.info('Found base interface config file: {f}'.format(f=base_ifcfg))

    # Delete the existing interface file if it exists
    if os.path.isfile(alias_ifcfg):
        log.info('Alias interface configuration file already exists, removing: {f}'.format(f=alias_ifcfg))
        try:
            os.remove(alias_ifcfg)
        except OSError:
            _, ex, trace = sys.exc_info()
            msg = 'OSError: There was a problem removing existing alias config file: {f}\n{e}'.format(
                f=alias_ifcfg, e=str(ex))
            raise OSError, msg, trace
    else:
        log.info('No existing alias interface configuration exists yet: {f}'.format(f=alias_ifcfg))

    # Create the interface file
    log.info('Gathering entries from file: {f}...'.format(f=base_ifcfg))
    ifcfg_entries = {}
    try:
        with open(base_ifcfg, 'r') as f:
            for line in f:
                if '=' in line:
                    parts = line.split('=')
                    if len(parts) == 2:
                        parts[0] = parts[0].strip()
                        parts[1] = parts[1].translate(None, '"').strip()
                        ifcfg_entries[parts[0]] = parts[1]
    except(IOError, OSError):
        _, ex, trace = sys.exc_info()
        msg = 'Unable to read file: {f}\n{e}'.format(f=base_ifcfg, e=str(ex))
        raise OSError, msg, trace

    # Defined the ifcfg file entries for the alias
    ifcfg_entries['IPADDR'] = ip_address
    ifcfg_entries['NETMASK'] = '255.255.255.0'
    ifcfg_entries['DEVICE'] = '{d}:0'.format(d=device_name)
    ifcfg_entries['NAME'] = '{d}:0'.format(d=device_name)

    log.info('Creating file: {f}'.format(f=alias_ifcfg))
    try:
        with open(alias_ifcfg, 'a') as f:
            for var, val in ifcfg_entries.iteritems():
                out_str = str(var) + '="' + str(val) + '"\n'
                log.info('Adding entry to %s: %s', alias_ifcfg, out_str)
                f.write(out_str)
    except(IOError, OSError):
        _, ex, trace = sys.exc_info()
        msg = 'Unable to write to file: {f}\n{e}'.format(f=alias_ifcfg, e=str(ex))
        raise OSError, msg, trace

    # Performing additional configuration for AWS
    if aws:
        log.info('Checking if this host is actually on AWS...')
        if is_aws():
            log.info('Performing additional configuration for AWS...')
            try:
                ec2 = EC2Util()
                ec2.add_secondary_ip(ip_address, interface)
            except EC2UtilError:
                _, ex, trace = sys.exc_info()
                msg = 'Unable to instruct AWS to add a secondary IP address <{ip}> on interface <{d}>\n{e}'.format(
                    ip=ip_address, d=device_name, e=str(ex))
                raise OSError, msg, trace
            else:
                log.info('AWS added the secondary IP address <{ip}> on interface <{d}>'.format(
                    ip=ip_address, d=device_name))
        else:
            log.warn('This system is not on AWS, not performing additional configuration')

    log.info('Restarting networking to ensure the changes take effect...')
    try:
        service_network_restart()
    except CommandError:
        _, ex, trace = sys.exc_info()
        msg = 'CommandError: There was a problem restarting network services\n{e}'.format(e=str(ex))
        raise NetworkRestartError, msg, trace

    # Verify the alias was created
    log.info('Verifying the alias was successfully created...')
    command = ['/sbin/ifconfig']
    try:
        result = run_command(command)
    except CommandError:
        _, ex, trace = sys.exc_info()
        log.warn('CommandError: Unable to run ifconfig to verify the IP alias was created\n{e}'.format(e=str(ex)))
        return

    # Check for the alias
    if '{d}:0'.format(d=device_name) not in result['output']:
        log.warn('The alias was not created yet, system reboot may be required: {d}:0'.format(d=device_name))
    else:
        log.info('Alias created successfully!')
Adds an IP alias to a specific interface

    Adds an ip address as an alias to the specified interface on
    Linux systems.

    :param ip_address: (str) IP address to set as an alias
    :param interface: (str) The interface number or full device name, if
        an int is provided assumes the device name is eth<i>
    :param aws (bool) True to perform additional AWS config
    :return: None