Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) - Add connect-timeout to transport #216

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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