code: def set_sys(layout):
      '''
      Set current system keyboard setting
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' keyboard.set_sys dvorak
      '''
      if salt.utils.path.which('localectl'):
          __salt__['cmd.run']('localectl set-keymap {0}'.format(layout))
      elif 'RedHat' in __grains__['os_family']:
          __salt__['file.sed']('/etc/sysconfig/keyboard',
                               '^LAYOUT=.*',
                               'LAYOUT={0}'.format(layout))
      elif 'Debian' in __grains__['os_family']:
          __salt__['file.sed']('/etc/default/keyboard',
                               '^XKBLAYOUT=.*',
                               'XKBLAYOUT={0}'.format(layout))
      elif 'Gentoo' in __grains__['os_family']:
          __salt__['file.sed']('/etc/conf.d/keymaps',
                               '^keymap=.*',
                               'keymap={0}'.format(layout))
      return layouf set_sys(layout):
      '''
      Set current system keyboard setting
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' keyboard.set_sys dvorak
      '''
      if salt.utils.path.which('localectl'):
          __salt__['cmd.run']('localectl set-keymap {0}'.format(layout))
      elif 'RedHat' in __grains__['os_family']:
          __salt__['file.sed']('/etc/sysconfig/keyboard',
                               '^LAYOUT=.*',
                               'LAYOUT={0}'.format(layout))
      elif 'Debian' in __grains__['os_family']:
          __salt__['file.sed']('/etc/default/keyboard',
                               '^XKBLAYOUT=.*',
                               'XKBLAYOUT={0}'.format(layout))
      elif 'Gentoo' in __grains__['os_family']:
          __salt__['file.sed']('/etc/conf.d/keymaps',
                               '^keymap=.*',
                               'keymap={0}'.format(layout))
      return layout
docs: Set current system keyboard setting
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' keyboard.set_sys dvorak