This is the development version of Kanrisuru. Since this is still a pre-1.0 release, we don't recommend using this in system-critical production environments.



Create a group in ruby
linux manual

Basic Usage

require 'kanrisuru'
host = '', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])'root')
result = host.create_group('kanrisuru', gid: 1003)



Field Type Description
group string
Required name of the group to create.
gid integer
The numerical value of the group's ID. This value must be unique unless the non_unique option is present.
non_unique boolean
This option permits to add a group with a non-unique GID.
system boolean
Create a system group.


Returns a single Group struct.

Group Fields

Field Type Description
gid integer The numerical value of the group's ID.
name string The name of the group.

Return Example'root')
host.create_group('admin', gid: 55, system: true).data
  gid = 55,
  name = "admin",
  users = nil

Exit Status

Code Description
0 Success
2 Invalid command syntax
3 Invalid argument to option
4 GID is already used (when called without -o)
9 Group name is already used
10 Can't update group file

Tested On

  • Ubuntu, Debian, Centos, Fedora, Redhat, OpenSuse, SLES