Get all ssh options from config
This commit is contained in:
@@ -46,6 +46,10 @@ class Mrsk::Configuration
|
||||
"traefik.http.middlewares.#{service}.retry.initialinterval" => "500ms"
|
||||
end
|
||||
|
||||
def ssh_options
|
||||
{ user: config.ssh_user || "root", auth_methods: [ "publickey" ] }
|
||||
end
|
||||
|
||||
private
|
||||
attr_accessor :config
|
||||
|
||||
|
||||
@@ -5,6 +5,4 @@ include SSHKit::DSL
|
||||
|
||||
MRSK_CONFIG = Mrsk::Configuration.load_file(Rails.root.join("config/deploy.yml"))
|
||||
|
||||
SSHKit::Backend::Netssh.configure do |ssh|
|
||||
ssh.ssh_options = { user: MRSK_CONFIG.ssh_user, auth_methods: [ "publickey" ] }
|
||||
end
|
||||
SSHKit::Backend::Netssh.configure { |ssh| ssh.ssh_options = MRSK_CONFIG.ssh_options }
|
||||
|
||||
Reference in New Issue
Block a user