Kanrisuru

update_group

Update a group in ruby
linux manual

Basic Usage

require 'kanrisuru'
host = Kanrisuru::Remote::Host.new(host: '127.0.1.1', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])

result = host.update_group('kanrisuru', gid: 5555, new_name: 'kdev')
result.success?
true

result.gid
5555

result.name
'kdev'

Parameters

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.

Result

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

host.update_group('kanrisuru', gid: 5555, new_name: 'kdev').data
#<Struct:Kanrisuru::Core::Group::Group:0x00000988
  gid = 5555,
  name = "kanrisuru",
  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)
6 Specified group doesn't exist
9 Group name is already used
10 Can't update group file
11 Can't setup cleanup service

Tested On

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