Sha256: 0a02acfcba376184b62f5393cc84b7aa28b9a9afe7e22fa486cba9b61ba03cfc

Contents?: true

Size: 658 Bytes

Versions: 172

Compression:

Stored size: 658 Bytes

Contents

class Specinfra::Command::Base::Group < Specinfra::Command::Base
  class << self
    def check_exists(group)
      "getent group #{escape(group)}"
    end

    def check_has_gid(group, gid)
      "getent group #{escape(group)} | cut -f 3 -d ':' | grep -w -- #{escape(gid)}"
    end

    def get_gid(group)
      "getent group #{escape(group)} | cut -f 3 -d ':'"
    end

    def update_gid(group, gid)
      "groupmod -g #{escape(gid)} #{escape(group)}"
    end

    def add(group, options)
      command = ['groupadd']
      command << '-g' << escape(options[:gid])  if options[:gid]
      command << escape(group)
      command.join(' ')
    end
  end
end

Version data entries

172 entries across 172 versions & 3 rubygems

Version Path
specinfra-2.79.0 lib/specinfra/command/base/group.rb
specinfra-2.78.2 lib/specinfra/command/base/group.rb
specinfra-2.78.1 lib/specinfra/command/base/group.rb
specinfra-2.78.0 lib/specinfra/command/base/group.rb
specinfra-2.77.3 lib/specinfra/command/base/group.rb
specinfra-2.77.2 lib/specinfra/command/base/group.rb
specinfra-2.77.1 lib/specinfra/command/base/group.rb
specinfra-2.77.0 lib/specinfra/command/base/group.rb
specinfra-2.76.9 lib/specinfra/command/base/group.rb
specinfra-2.76.8 lib/specinfra/command/base/group.rb
specinfra-2.76.7 lib/specinfra/command/base/group.rb
specinfra-2.76.6 lib/specinfra/command/base/group.rb
specinfra-2.76.5 lib/specinfra/command/base/group.rb
specinfra-2.76.4 lib/specinfra/command/base/group.rb
specinfra-2.76.3 lib/specinfra/command/base/group.rb
specinfra-2.76.2 lib/specinfra/command/base/group.rb
specinfra-2.76.1 lib/specinfra/command/base/group.rb
specinfra-2.76.0 lib/specinfra/command/base/group.rb
specinfra-2.75.1 lib/specinfra/command/base/group.rb
specinfra-rb19-2.44.7 lib/specinfra/command/base/group.rb