Skip to content

Commit

Permalink
Merge pull request #185 from MikaelSmith/fix-no-ssh-key
Browse files Browse the repository at this point in the history
(bug) Fix abs checkout when 'ABS_SSH_PRIVATE_KEY' is unset
  • Loading branch information
MikaelSmith authored Dec 14, 2021
2 parents 0276ddf + 70ce5ac commit 183fefe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/abs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def provision(platform, inventory_location, vars)
node = { 'uri' => host['hostname'],
'config' => { 'transport' => 'ssh', 'ssh' => { 'user' => ENV['ABS_USER'], 'host-key-check' => false } },
'facts' => { 'provisioner' => 'abs', 'platform' => host['type'], 'job_id' => job_id } }
if !ENV['ABS_SSH_PRIVATE_KEY'].empty?
if !ENV['ABS_SSH_PRIVATE_KEY'].nil? && !ENV['ABS_SSH_PRIVATE_KEY'].empty?
node['config']['ssh']['private-key'] = ENV['ABS_SSH_PRIVATE_KEY']
else
node['config']['ssh']['password'] = ENV['ABS_PASSWORD']
Expand Down

0 comments on commit 183fefe

Please sign in to comment.