Skip to content

Commit

Permalink
ensure we retry, in case we're waiting on a jenkin restart - addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
madAndroid committed Dec 4, 2014
1 parent 7607697 commit cbdb05c
Showing 1 changed file with 9 additions and 5 deletions.
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 cbdb05c

Please sign in to comment.