def build_bond(iface, **settings):
 rh_major = __grains__['osrelease'][:1]
 opts = _parse_settings_bond(settings, iface)
 try:
  template = JINJA.get_template('conf.jinja')
 except jinja2.exceptions.TemplateNotFound:
  log.error('Could not load template conf.jinja')
  return ''
 data = template.render({'name': iface, 'bonding': opts})
 _write_file_iface(iface, data, _RH_NETWORK_CONF_FILES, '{0}.conf'.format(iface))
 path = os.path.join(_RH_NETWORK_CONF_FILES, '{0}.conf'.format(iface))
 if (rh_major == '5'):
  __salt__['cmd.run']('sed -i -e "/^alias\\s{0}.*/d" /etc/modprobe.conf'.format(iface), python_shell=False)
  __salt__['cmd.run']('sed -i -e "/^options\\s{0}.*/d" /etc/modprobe.conf'.format(iface), python_shell=False)
  __salt__['file.append']('/etc/modprobe.conf', path)
 __salt__['kmod.load']('bonding')
 if settings['test']:
  return _read_temp(data)
 return _read_file(path)

def build_bond ( iface , ** settings ) : rh_major = __grains__ [ 'osrelease' ] [ : 1 ] opts = _parse_settings_bond ( settings , iface ) try : template = JINJA . get_template ( 'conf.jinja' ) except jinja2 . exceptions . TemplateNotFound : log . error ( 'Could not load template conf.jinja' ) return '' data = template . render ( { 'name' : iface , 'bonding' : opts } ) _write_file_iface ( iface , data , _RH_NETWORK_CONF_FILES , '{0}.conf' . format ( iface ) ) path = os . path . join ( _RH_NETWORK_CONF_FILES , '{0}.conf' . format ( iface ) ) if ( rh_major == '5' ) : __salt__ [ 'cmd.run' ] ( 'sed -i -e "/^alias\\s{0}.*/d" /etc/modprobe.conf' . format ( iface ) , python_shell = False ) __salt__ [ 'cmd.run' ] ( 'sed -i -e "/^options\\s{0}.*/d" /etc/modprobe.conf' . format ( iface ) , python_shell = False ) __salt__ [ 'file.append' ] ( '/etc/modprobe.conf' , path ) __salt__ [ 'kmod.load' ] ( 'bonding' ) if settings [ 'test' ] : return _read_temp ( data ) return _read_file ( path )
create a bond script in /etc/modprobe .