Skip to content

Commit caf25e5

Browse files
authored
Merge pull request #216 from puppetlabs/maint-add_connect-timeout
(maint) - Add connect-timeout to transport
2 parents 8d33b79 + 2db5d9b commit caf25e5

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

tasks/abs.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def provision(platform, inventory_location, vars)
9191
data.each do |host|
9292
if platform_uses_ssh(host['type'])
9393
node = { 'uri' => host['hostname'],
94-
'config' => { 'transport' => 'ssh', 'ssh' => { 'user' => ENV['ABS_USER'], 'host-key-check' => false } },
94+
'config' => { 'transport' => 'ssh', 'ssh' => { 'user' => ENV['ABS_USER'], 'host-key-check' => false, 'connect-timeout' => 120 } },
9595
'facts' => { 'provisioner' => 'abs', 'platform' => host['type'], 'job_id' => job_id } }
9696
if !ENV['ABS_SSH_PRIVATE_KEY'].nil? && !ENV['ABS_SSH_PRIVATE_KEY'].empty?
9797
node['config']['ssh']['private-key'] = ENV['ABS_SSH_PRIVATE_KEY']
@@ -101,7 +101,7 @@ def provision(platform, inventory_location, vars)
101101
group_name = 'ssh_nodes'
102102
else
103103
node = { 'uri' => host['hostname'],
104-
'config' => { 'transport' => 'winrm', 'winrm' => { 'user' => ENV['ABS_WIN_USER'], 'password' => ENV['ABS_PASSWORD'], 'ssl' => false } },
104+
'config' => { 'transport' => 'winrm', 'winrm' => { 'user' => ENV['ABS_WIN_USER'], 'password' => ENV['ABS_PASSWORD'], 'ssl' => false, 'connect-timeout' => 120 } },
105105
'facts' => { 'provisioner' => 'abs', 'platform' => host['type'], 'job_id' => job_id } }
106106
group_name = 'winrm_nodes'
107107
end

tasks/docker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def provision(image, inventory_location, vars)
162162
'uri' => "#{hostname}:#{front_facing_port}",
163163
'config' => {
164164
'transport' => 'ssh',
165-
'ssh' => { 'user' => 'root', 'password' => 'root', 'port' => front_facing_port, 'host-key-check' => false }
165+
'ssh' => { 'user' => 'root', 'password' => 'root', 'port' => front_facing_port, 'host-key-check' => false, 'connect-timeout' => 120 }
166166
},
167167
'facts' => {
168168
'provisioner' => 'docker',

tasks/docker_exp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def provision(docker_platform, inventory_location, vars)
2929
container_id = run_local_command(creation_command).strip[0..11]
3030
fix_missing_tty_error_message(container_id) unless platform_is_windows?(docker_platform)
3131
node = { 'uri' => container_id,
32-
'config' => { 'transport' => 'docker', 'docker' => { 'shell-command' => @shell_command } },
32+
'config' => { 'transport' => 'docker', 'docker' => { 'shell-command' => @shell_command, 'connect-timeout' => 120 } },
3333
'facts' => { 'provisioner' => 'docker_exp', 'container_id' => container_id, 'platform' => docker_platform } }
3434
unless vars.nil?
3535
var_hash = YAML.safe_load(vars)

tasks/vagrant.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ def provision(platform, inventory_location, enable_synced_folder, provider, cpus
150150
'host' => remote_config['hostname'],
151151
'host-key-check' => remote_config['stricthostkeychecking'],
152152
'port' => remote_config['port'],
153-
'run-as' => 'root'
153+
'run-as' => 'root',
154+
'connect-timeout' => 120
154155
}
155156
},
156157
'facts' => {
@@ -173,7 +174,8 @@ def provision(platform, inventory_location, enable_synced_folder, provider, cpus
173174
'winrm' => {
174175
'user' => remote_config['user'],
175176
'password' => remote_config['password'],
176-
'ssl' => remote_config['uses_ssl']
177+
'ssl' => remote_config['uses_ssl'],
178+
'connect-timeout' => 120
177179
}
178180
},
179181
'facts' => {

0 commit comments

Comments
 (0)