Skip to content

Commit

Permalink
(maint) - Add connect-timeout to transport
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed May 4, 2023
1 parent 8d33b79 commit 2db5d9b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tasks/abs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def provision(platform, inventory_location, vars)
data.each do |host|
if platform_uses_ssh(host['type'])
node = { 'uri' => host['hostname'],
'config' => { 'transport' => 'ssh', 'ssh' => { 'user' => ENV['ABS_USER'], 'host-key-check' => false } },
'config' => { 'transport' => 'ssh', 'ssh' => { 'user' => ENV['ABS_USER'], 'host-key-check' => false, 'connect-timeout' => 120 } },
'facts' => { 'provisioner' => 'abs', 'platform' => host['type'], 'job_id' => job_id } }
if !ENV['ABS_SSH_PRIVATE_KEY'].nil? && !ENV['ABS_SSH_PRIVATE_KEY'].empty?
node['config']['ssh']['private-key'] = ENV['ABS_SSH_PRIVATE_KEY']
Expand All @@ -101,7 +101,7 @@ def provision(platform, inventory_location, vars)
group_name = 'ssh_nodes'
else
node = { 'uri' => host['hostname'],
'config' => { 'transport' => 'winrm', 'winrm' => { 'user' => ENV['ABS_WIN_USER'], 'password' => ENV['ABS_PASSWORD'], 'ssl' => false } },
'config' => { 'transport' => 'winrm', 'winrm' => { 'user' => ENV['ABS_WIN_USER'], 'password' => ENV['ABS_PASSWORD'], 'ssl' => false, 'connect-timeout' => 120 } },
'facts' => { 'provisioner' => 'abs', 'platform' => host['type'], 'job_id' => job_id } }
group_name = 'winrm_nodes'
end
Expand Down
2 changes: 1 addition & 1 deletion tasks/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def provision(image, inventory_location, vars)
'uri' => "#{hostname}:#{front_facing_port}",
'config' => {
'transport' => 'ssh',
'ssh' => { 'user' => 'root', 'password' => 'root', 'port' => front_facing_port, 'host-key-check' => false }
'ssh' => { 'user' => 'root', 'password' => 'root', 'port' => front_facing_port, 'host-key-check' => false, 'connect-timeout' => 120 }
},
'facts' => {
'provisioner' => 'docker',
Expand Down
2 changes: 1 addition & 1 deletion tasks/docker_exp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def provision(docker_platform, inventory_location, vars)
container_id = run_local_command(creation_command).strip[0..11]
fix_missing_tty_error_message(container_id) unless platform_is_windows?(docker_platform)
node = { 'uri' => container_id,
'config' => { 'transport' => 'docker', 'docker' => { 'shell-command' => @shell_command } },
'config' => { 'transport' => 'docker', 'docker' => { 'shell-command' => @shell_command, 'connect-timeout' => 120 } },
'facts' => { 'provisioner' => 'docker_exp', 'container_id' => container_id, 'platform' => docker_platform } }
unless vars.nil?
var_hash = YAML.safe_load(vars)
Expand Down
6 changes: 4 additions & 2 deletions tasks/vagrant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def provision(platform, inventory_location, enable_synced_folder, provider, cpus
'host' => remote_config['hostname'],
'host-key-check' => remote_config['stricthostkeychecking'],
'port' => remote_config['port'],
'run-as' => 'root'
'run-as' => 'root',
'connect-timeout' => 120
}
},
'facts' => {
Expand All @@ -173,7 +174,8 @@ def provision(platform, inventory_location, enable_synced_folder, provider, cpus
'winrm' => {
'user' => remote_config['user'],
'password' => remote_config['password'],
'ssl' => remote_config['uses_ssl']
'ssl' => remote_config['uses_ssl'],
'connect-timeout' => 120
}
},
'facts' => {
Expand Down

0 comments on commit 2db5d9b

Please sign in to comment.