Sha256: 614ff3e2960e164e9e04eb9594038222a6c96e985681733a91b994dcfe30a0bb

Contents?: true

Size: 1.13 KB

Versions: 231

Compression:

Stored size: 1.13 KB

Contents

require 'puppet/provider/nameservice/pw'

Puppet::Type.type(:group).provide :pw, :parent => Puppet::Provider::NameService::PW do
  desc "Group management via `pw` on FreeBSD and DragonFly BSD."

  commands :pw => "pw"
  has_features :manages_members

  defaultfor :operatingsystem => [:freebsd, :dragonfly]
  confine    :operatingsystem => [:freebsd, :dragonfly]

  options :members, :flag => "-M", :method => :mem

  verify :gid, _("GID must be an integer") do |value|
    value.is_a? Integer
  end

  def addcmd
    cmd = [command(:pw), "groupadd", @resource[:name]]

    if gid = @resource.should(:gid)
      unless gid == :absent
        cmd << flag(:gid) << gid
      end
    end

    if members = @resource.should(:members)
      unless members == :absent
        if members.is_a?(Array)
          members = members.join(",")
        end
        cmd << "-M" << members
      end
    end

    cmd << "-o" if @resource.allowdupe?

    cmd
  end

  def modifycmd(param, value)
    # members may be an array, need a comma separated list
    if param == :members and value.is_a?(Array)
      value = value.join(",")
    end
    super(param, value)
  end
end

Version data entries

231 entries across 231 versions & 2 rubygems

Version Path
puppet-5.5.22 lib/puppet/provider/group/pw.rb
puppet-5.5.22-x86-mingw32 lib/puppet/provider/group/pw.rb
puppet-5.5.22-x64-mingw32 lib/puppet/provider/group/pw.rb
puppet-5.5.22-universal-darwin lib/puppet/provider/group/pw.rb
puppet-5.5.21 lib/puppet/provider/group/pw.rb
puppet-5.5.21-x86-mingw32 lib/puppet/provider/group/pw.rb
puppet-5.5.21-x64-mingw32 lib/puppet/provider/group/pw.rb
puppet-5.5.21-universal-darwin lib/puppet/provider/group/pw.rb
puppet-5.5.20 lib/puppet/provider/group/pw.rb
puppet-5.5.20-x86-mingw32 lib/puppet/provider/group/pw.rb
puppet-5.5.20-x64-mingw32 lib/puppet/provider/group/pw.rb
puppet-5.5.20-universal-darwin lib/puppet/provider/group/pw.rb
puppet-5.5.19 lib/puppet/provider/group/pw.rb
puppet-5.5.19-x86-mingw32 lib/puppet/provider/group/pw.rb
puppet-5.5.19-x64-mingw32 lib/puppet/provider/group/pw.rb
puppet-5.5.19-universal-darwin lib/puppet/provider/group/pw.rb
puppet-5.5.18 lib/puppet/provider/group/pw.rb
puppet-5.5.18-x86-mingw32 lib/puppet/provider/group/pw.rb
puppet-6.4.5 lib/puppet/provider/group/pw.rb
puppet-5.5.18-x64-mingw32 lib/puppet/provider/group/pw.rb