mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
move user default settings to backend
This commit is contained in:
parent
51fff9104b
commit
d0d9a66e4a
2 changed files with 7 additions and 3 deletions
|
@ -21,7 +21,7 @@ module Vulcano
|
|||
conf['backend'] = conf['backend'] || uri.scheme
|
||||
conf['host'] = conf['host'] || uri.host
|
||||
conf['port'] = conf['port'] || uri.port
|
||||
conf['user'] = conf['user'] || uri.user || 'root'
|
||||
conf['user'] = conf['user'] || uri.user
|
||||
conf['password'] = conf['password'] || uri.password
|
||||
|
||||
# return the updated config
|
||||
|
|
|
@ -115,7 +115,7 @@ module Vulcano::Backends
|
|||
user_known_hosts_file: '/dev/null',
|
||||
global_known_hosts_file: '/dev/null',
|
||||
number_of_password_prompts: 0,
|
||||
user: @conf['user'],
|
||||
user: @conf['user'] || 'root',
|
||||
password: @conf['password'],
|
||||
keys: [@conf['key_file']].compact,
|
||||
}
|
||||
|
@ -149,7 +149,11 @@ module Vulcano::Backends
|
|||
# validation
|
||||
user = @conf['user'].to_s
|
||||
pass = @conf['password'].to_s
|
||||
fail 'You must configure a WinRM user for login.' if user.empty?
|
||||
|
||||
if user.empty?
|
||||
warn "We use default 'Administrator' as WinRM user for login."
|
||||
user = 'Administrator'
|
||||
end
|
||||
fail 'You must configure a WinRM password.' if pass.empty?
|
||||
|
||||
# create the connection
|
||||
|
|
Loading…
Reference in a new issue