Class: Wright::Provider::User
- Inherits:
-
Wright::Provider
- Object
- Wright::Provider
- Wright::Provider::User
- Defined in:
- lib/wright/provider/user.rb,
lib/wright/provider/user/gnu_passwd.rb,
lib/wright/provider/user/darwin_directory_service.rb
Overview
User provider. Used as a base class for Resource::User providers.
Direct Known Subclasses
Defined Under Namespace
Classes: DarwinDirectoryService, GnuPasswd
Constant Summary
Constants inherited from Wright::Provider
Instance Method Summary collapse
-
#create ⇒ void
Creates or updates the user.
-
#remove ⇒ void
Removes the user.
Methods inherited from Wright::Provider
Constructor Details
This class inherits a constructor from Wright::Provider
Instance Method Details
#create ⇒ void
This method returns an undefined value.
Creates or updates the user.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/wright/provider/user.rb', line 13 def create unless_uptodate(:create, "user already created: '#{user_name}'") do unless_dry_run("create user: '#{user_name}'") do if user_exists? update_user else create_user end end end end |
#remove ⇒ void
This method returns an undefined value.
Removes the user.
28 29 30 31 32 33 34 |
# File 'lib/wright/provider/user.rb', line 28 def remove unless_uptodate(:remove, "user already removed: '#{user_name}'") do unless_dry_run("remove user: '#{user_name}'") do remove_user end end end |