Module: Rudy::Routines::UserHelper
Instance Method Summary
collapse
Methods included from HelperBase
#command_separator, #execute_rbox_command, #keep_going?
Methods included from Huxtable
change_environment, change_position, change_region, change_role, change_zone, #check_keys, #config_dirname, create_domain, #current_group_name, #current_machine_address, #current_machine_count, #current_machine_group, #current_machine_hostname, #current_machine_image, #current_machine_name, #current_machine_size, #current_user, #current_user_keypairpath, debug?, #debug?, domain, domain_exists?, #group_metadata, #has_keypair?, #has_keys?, #has_pem_keys?, #has_root_keypair?, keypair_path_to_name, #known_machine_group?, #root_keypairname, #root_keypairpath, #switch_user, update_config, update_global, update_logger, #user_keypairname, #user_keypairpath
Instance Method Details
#adduser(routine, machine, rbox) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/rudy/routines/helpers/userhelper.rb', line 10
def adduser(routine, machine, rbox)
homedir = rbox.guess_user_home(routine.adduser.to_s)
args = [:m, :d, homedir, :s, '/bin/bash', routine.adduser.to_s]
puts command_separator(rbox.preview_command(:useradd, args), rbox.user)
execute_rbox_command { rbox.useradd(args) }
end
|
#adduser?(routine) ⇒ Boolean
7
8
9
|
# File 'lib/rudy/routines/helpers/userhelper.rb', line 7
def adduser?(routine)
(!routine.adduser.nil? && !routine.adduser.to_s.empty?)
end
|
#authorize(routine, machine, rbox) ⇒ Object
29
30
31
32
|
# File 'lib/rudy/routines/helpers/userhelper.rb', line 29
def authorize(routine, machine, rbox)
puts command_separator(:authorize_keys_remote, rbox.user)
execute_rbox_command { rbox.authorize_keys_remote(routine.authorize) }
end
|
#authorize?(routine) ⇒ Boolean
26
27
28
|
# File 'lib/rudy/routines/helpers/userhelper.rb', line 26
def authorize?(routine)
(!routine.authorize.nil? && !routine.authorize.to_s.empty?)
end
|