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

convert raw execs of puppet_helper.groovy to jenkins::cli::exec define #285

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 8 additions & 15 deletions manifests/credentials.pp
Expand Up @@ -31,31 +31,24 @@
validate_string($password)
validate_string($description)
validate_string($private_key_or_path)
exec { "create-jenkins-credentials-${title}":
command => join([
$::jenkins::cli_helper::helper_cmd,
jenkins::cli::exec { "create-jenkins-credentials-${title}":
command => [
'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}",
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
],
unless => "\$HELPER_CMD credential_info ${title} | grep ${title}",
}
}
'absent': {
exec { "delete-jenkins-credentials-${title}":
command => join([
$::jenkins::cli_helper::helper_cmd,
# XXX not idempotent
jenkins::cli::exec { "delete-jenkins-credentials-${title}":
command => [
'delete_credentials',
$title,
], ' '),
require => Class['::jenkins::cli_helper'],
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
],
}
}
default: {
Expand Down
9 changes: 3 additions & 6 deletions manifests/security.pp
Expand Up @@ -23,14 +23,11 @@

include ::jenkins::cli_helper

# XXX not idempotent
exec { "jenkins-security-${security_model}":
command => join([
$::jenkins::cli_helper::helper_cmd,
command => [
'set_security',
$security_model,
], ' '),
require => Class['::jenkins::cli_helper'],
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
],
}
}
22 changes: 8 additions & 14 deletions manifests/user.pp
Expand Up @@ -33,31 +33,25 @@
validate_string($password)
validate_string($full_name)
validate_string($public_key)
exec { "create-jenkins-user-${title}":
command => join([
$::jenkins::cli_helper::helper_cmd,
# XXX not idempotent
jenkins::cli::exec { "create-jenkins-user-${title}":
command => [
'create_or_update_user',
$title,
$email,
"'${password}'",
"'${full_name}'",
"'${public_key}'",
], ' '),
require => Class['::jenkins::cli_helper'],
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
],
}
}
'absent': {
exec { "delete-jenkins-user-${title}":
command => join([
$::jenkins::cli_helper::helper_cmd,
# XXX not idempotent
jenkins::cli::exec { "delete-jenkins-user-${title}":
command => [
'delete_user',
$title,
], ' '),
require => Class['::jenkins::cli_helper'],
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
],
}
}
default: {
Expand Down