Class: Wright::Resource::User
- Inherits:
-
Wright::Resource
- Object
- Wright::Resource
- Wright::Resource::User
- Defined in:
- lib/wright/resource/user.rb
Overview
User resource, represents a user.
Instance Attribute Summary collapse
-
#full_name ⇒ String
The user’s intended full name.
-
#groups ⇒ Array<String>
The user’s intended groups.
-
#home ⇒ String
(also: #homedir)
The user’s intended home directory path.
-
#primary_group ⇒ String, Integer
(also: #login_group)
The user’s intended primary group.
-
#shell ⇒ String
The user’s intended shell.
-
#system ⇒ Bool
True if the user should be a system user.
-
#uid ⇒ Integer
The user’s intended user id.
Attributes inherited from Wright::Resource
#action, #ignore_failure, #name, #resource_name
Instance Method Summary collapse
-
#create ⇒ Bool
Creates or updates the user.
-
#initialize(name) ⇒ User
constructor
Initializes a user.
-
#remove ⇒ Bool
Removes the user.
Methods inherited from Wright::Resource
Constructor Details
#initialize(name) ⇒ User
Initializes a user.
40 41 42 43 44 |
# File 'lib/wright/resource/user.rb', line 40 def initialize(name) super @action = :create @system = false end |
Instance Attribute Details
#full_name ⇒ String
Returns the user’s intended full name.
17 18 19 |
# File 'lib/wright/resource/user.rb', line 17 def full_name @full_name end |
#groups ⇒ Array<String>
Returns the user’s intended groups.
20 21 22 |
# File 'lib/wright/resource/user.rb', line 20 def groups @groups end |
#home ⇒ String Also known as: homedir
Returns the user’s intended home directory path.
26 27 28 |
# File 'lib/wright/resource/user.rb', line 26 def home @home end |
#primary_group ⇒ String, Integer Also known as: login_group
Returns the user’s intended primary group.
30 31 32 |
# File 'lib/wright/resource/user.rb', line 30 def primary_group @primary_group end |
#shell ⇒ String
Returns the user’s intended shell.
23 24 25 |
# File 'lib/wright/resource/user.rb', line 23 def shell @shell end |
#system ⇒ Bool
Returns true if the user should be a system user. Ignored if #uid is set.
35 36 37 |
# File 'lib/wright/resource/user.rb', line 35 def system @system end |
#uid ⇒ Integer
Returns the user’s intended user id.
14 15 16 |
# File 'lib/wright/resource/user.rb', line 14 def uid @uid end |
Instance Method Details
#create ⇒ Bool
Creates or updates the user.
50 51 52 53 54 |
# File 'lib/wright/resource/user.rb', line 50 def create might_update_resource do @provider.create end end |
#remove ⇒ Bool
Removes the user.
60 61 62 63 64 |
# File 'lib/wright/resource/user.rb', line 60 def remove might_update_resource do @provider.remove end end |