code: def create_device_role(role, color):
      '''
      .. versionadded:: 2019.2.0
  
      Create a device role
  
      role
          String of device role, e.g., ``router``
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion netbox.create_device_role router
      '''
      nb_role = get_('dcim', 'device-roles', name=role)
      if nb_role:
          return False
      else:
          payload = {'name': role, 'slug': slugify(role), 'color': color}
          role = _add('dcim', 'device-roles', payload)
          if role:
              return{'dcim': {'device-roles': payload}}
          else:
              return Falsf create_device_role(role, color):
      '''
      .. versionadded:: 2019.2.0
  
      Create a device role
  
      role
          String of device role, e.g., ``router``
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion netbox.create_device_role router
      '''
      nb_role = get_('dcim', 'device-roles', name=role)
      if nb_role:
          return False
      else:
          payload = {'name': role, 'slug': slugify(role), 'color': color}
          role = _add('dcim', 'device-roles', payload)
          if role:
              return{'dcim': {'device-roles': payload}}
          else:
              return False
docs: .. versionadded:: 2019.2.0
  
      Create a device role
  
      role
          String of device role, e.g., ``router``
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion netbox.create_device_role router