Class: DInstaller::DBus::Clients::Users
- Includes:
- WithServiceStatus
- Defined in:
- lib/dinstaller/dbus/clients/users.rb
Overview
D-Bus client for users configuration
Instance Method Summary collapse
-
#create_first_user(name, fullname: nil, password: nil, autologin: false) ⇒ Object
Configures the first user to create during the installation.
-
#first_user ⇒ Array<String, String, Boolean>
Configuration of the first user to create during the installation.
-
#initialize ⇒ Users
constructor
A new instance of Users.
-
#remove_first_user ⇒ Object
Removes the configuration of the first user.
-
#remove_root_info ⇒ Object
Removes the SSH key and password for root.
-
#root_password=(value) ⇒ Object
Sets the root password.
-
#root_password? ⇒ Boolean
Whether the root password is set.
-
#root_ssh_key ⇒ String
SSH key for root.
-
#root_ssh_key=(value) ⇒ Object
Sets the SSH key for root.
- #service_name ⇒ String
-
#write ⇒ Object
Commit the changes.
Methods included from WithServiceStatus
#on_service_status_change, #service_status, #to_service_status
Methods inherited from Base
Constructor Details
#initialize ⇒ Users
Returns a new instance of Users.
32 33 34 35 36 37 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 32 def initialize super @dbus_object = service["/org/opensuse/DInstaller/Users1"] @dbus_object.introspect end |
Instance Method Details
#create_first_user(name, fullname: nil, password: nil, autologin: false) ⇒ Object
Configures the first user to create during the installation
57 58 59 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 57 def create_first_user(name, fullname: nil, password: nil, autologin: false) dbus_object.SetFirstUser(fullname.to_s, name, password.to_s, !!autologin, {}) end |
#first_user ⇒ Array<String, String, Boolean>
Configuration of the first user to create during the installation
47 48 49 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 47 def first_user dbus_object["org.opensuse.DInstaller.Users1"]["FirstUser"][0..2] end |
#remove_first_user ⇒ Object
Removes the configuration of the first user
62 63 64 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 62 def remove_first_user dbus_object.RemoveFirstUser end |
#remove_root_info ⇒ Object
Removes the SSH key and password for root
95 96 97 98 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 95 def remove_root_info dbus_object.RemoveRootPassword dbus_object.SetRootSSHKey("") end |
#root_password=(value) ⇒ Object
Sets the root password
90 91 92 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 90 def root_password=(value) dbus_object.SetRootPassword(value, false) end |
#root_password? ⇒ Boolean
Whether the root password is set
83 84 85 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 83 def root_password? dbus_object["org.opensuse.DInstaller.Users1"]["RootPasswordSet"] end |
#root_ssh_key ⇒ String
SSH key for root
69 70 71 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 69 def root_ssh_key dbus_object["org.opensuse.DInstaller.Users1"]["RootSSHKey"] end |
#root_ssh_key=(value) ⇒ Object
Sets the SSH key for root
76 77 78 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 76 def root_ssh_key=(value) dbus_object.SetRootSSHKey(value) end |
#service_name ⇒ String
40 41 42 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 40 def service_name @service_name ||= "org.opensuse.DInstaller.Users" end |
#write ⇒ Object
Commit the changes
101 102 103 |
# File 'lib/dinstaller/dbus/clients/users.rb', line 101 def write dbus_object.Write end |