Skip to content

Commit

Permalink
Merge pull request voxpupuli#222 from madAndroid/add_retry_to_credent…
Browse files Browse the repository at this point in the history
…ials_execs

Add retry to credentials execs
  • Loading branch information
R. Tyler Croy committed Dec 6, 2014
2 parents 7607697 + 288a065 commit 974e278
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ group :development do
gem 'simplecov'
gem 'parallel_tests'
gem 'ci_reporter'
gem 'debugger', :platform => :mri
gem 'debugger-pry', :platform => :mri
gem 'debugger', :platform => :mri_19
gem 'debugger-pry', :platform => :mri_19
gem 'byebug', :platform => [:mri_20, :mri_21]

gem 'serverspec'
gem 'vagrant', :github => 'mitchellh/vagrant',
Expand Down
14 changes: 9 additions & 5 deletions manifests/credentials.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,30 @@
validate_string($description)
validate_string($private_key_or_path)
exec { "create-jenkins-credentials-${title}":
command => join([
command => join([
$::jenkins::cli_helper::helper_cmd,
'create_or_update_credentials',
$title,
"'${password}'",
"'${description}'",
"'${private_key_or_path}'",
], ' '),
require => Class['::jenkins::cli_helper'],
unless => "${::jenkins::cli_helper::helper_cmd} credential_info ${title} | grep ${title}",
require => Class['::jenkins::cli_helper'],
unless => "${::jenkins::cli_helper::helper_cmd} credential_info ${title} | grep ${title}",
tries => 3,
try_sleep => 5,
}
}
'absent': {
exec { "delete-jenkins-credentials-${title}":
command => join([
command => join([
$::jenkins::cli_helper::helper_cmd,
'delete_credentials',
$title,
], ' '),
require => Class['::jenkins::cli_helper'],
require => Class['::jenkins::cli_helper'],
tries => 3,
try_sleep => 5,
}
}
default: {
Expand Down

0 comments on commit 974e278

Please sign in to comment.