How to set user flood limit role wise? If user account is locked after entering wrong password 5 times. That's a default setting.
That can be changed via
drush cset user.flood user_limit 10

I have different roles. I need to set flood user_limit role wise
Role A, It will be 10
Role B, It will be 7

Can we achieve same thing via CLI?
No you can't.
The user.flood user_limit config setting feeds into the DatabaseBackend::isAllowed() method as the $threshold arg, which is used to compare the row count for this query:
  $number = $this-&gt;connection
      -&gt;select(static::TABLE_NAME, 'f')
      -&gt;condition('event', $name)
      -&gt;condition('identifier', $identifier)
      -&gt;condition('timestamp', REQUEST_TIME - $window, '&gt;')
      -&gt;countQuery()
      -&gt;execute()
      -&gt;fetchField();

It only compares the threshold login count against a unique user ID, $identifier.
You'd have to do some sort of modification to the flood core service to make some sort of per-role flood limit.