Sha256: bfaad6225e742407b7c85712108f51cd12641e160a65097b62d3327a5030f591

Contents?: true

Size: 1.02 KB

Versions: 35

Compression:

Stored size: 1.02 KB

Contents

require 'puppet/provider/nameservice/pw'

Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::PW do
  desc "User management via `pw` on FreeBSD."

  commands :pw => "pw"
  has_features :manages_homedir, :allows_duplicates

  defaultfor :operatingsystem => :freebsd

  options :home, :flag => "-d", :method => :dir
  options :comment, :method => :gecos
  options :groups, :flag => "-G"

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

  verify :groups, "Groups must be comma-separated" do |value|
    value !~ /\s/
  end

  def addcmd
    cmd = [command(:pw), "useradd", @resource[:name]]
    @resource.class.validproperties.each do |property|
      next if property == :ensure
      # the value needs to be quoted, mostly because -c might
      # have spaces in it
      if value = @resource.should(property) and value != ""
        cmd << flag(property) << value
      end
    end

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

    cmd << "-m" if @resource.managehome?

    cmd
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
puppet-2.6.18 lib/puppet/provider/user/pw.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
supply_drop-0.10.2 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
puppet-2.6.17 lib/puppet/provider/user/pw.rb
supply_drop-0.10.1 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
supply_drop-0.10.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
puppet-2.6.16 lib/puppet/provider/user/pw.rb
puppet-2.6.15 lib/puppet/provider/user/pw.rb
supply_drop-0.9.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
supply_drop-0.8.1 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
supply_drop-0.8.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
puppet-2.6.14 lib/puppet/provider/user/pw.rb
supply_drop-0.7.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
supply_drop-0.6.1 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
supply_drop-0.6.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/provider/user/pw.rb
puppet-2.6.13 lib/puppet/provider/user/pw.rb
puppet-2.7.9 lib/puppet/provider/user/pw.rb
puppet-2.7.8 lib/puppet/provider/user/pw.rb
puppet-2.7.6 lib/puppet/provider/user/pw.rb
puppet-2.6.12 lib/puppet/provider/user/pw.rb