Skip to content

Commit

Permalink
fixes user timeouts on restart
Browse files Browse the repository at this point in the history
increased timeouts
added timouts to security and increased credential timeouts

moved retry values into param
  • Loading branch information
endyman committed Jan 10, 2015
1 parent 3880b34 commit 21dd8b5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 25 deletions.
12 changes: 6 additions & 6 deletions manifests/credentials.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -42,8 +42,8 @@
], ' '),
require => Class['::jenkins::cli_helper'],
unless => "${::jenkins::cli_helper::helper_cmd} credential_info ${title} | grep ${title}",
tries => 3,
try_sleep => 5,
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
}
}
'absent': {
Expand All @@ -54,8 +54,8 @@
$title,
], ' '),
require => Class['::jenkins::cli_helper'],
tries => 3,
try_sleep => 5,
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
}
}
default: {
Expand Down
10 changes: 10 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
# - CLI installation (both implicit and explicit) requires the unzip command
#
#
# cli_tries = 10 (default)
# Retries until giving up talking to jenkins API
#
#
# cli_try_sleep = 10 (default)
# Seconds between tries to contact jenkins API
#
#
# proxy_host = undef (default)
# proxy_port = undef (default)
# If your environment requires a proxy host to download plugins it can be configured here
Expand All @@ -112,6 +120,8 @@
$proxy_port = undef,
$no_proxy_list = undef,
$cli = undef,
$cli_tries = $jenkins::params::cli_tries,
$cli_try_sleep = $jenkins::params::cli_try_sleep,
$port = $jenkins::params::port,
$libdir = $jenkins::params::libdir,
) inherits jenkins::params {
Expand Down
20 changes: 11 additions & 9 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
#
#
class jenkins::params {
$version = 'installed'
$lts = false
$repo = true
$service_enable = true
$service_ensure = 'running'
$install_java = true
$swarm_version = '1.19'
$default_plugins_host = 'http://updates.jenkins-ci.org'
$port = '8080'
$version = 'installed'
$lts = false
$repo = true
$service_enable = true
$service_ensure = 'running'
$install_java = true
$swarm_version = '1.19'
$default_plugins_host = 'http://updates.jenkins-ci.org'
$port = '8080'
$cli_tries = 10
$cli_try_sleep = 10

case $::osfamily {
'Debian': {
Expand Down
10 changes: 6 additions & 4 deletions manifests/security.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -24,11 +24,13 @@
include ::jenkins::cli_helper

exec { "jenkins-security-${security_model}":
command => join([
command => join([
$::jenkins::cli_helper::helper_cmd,
'set_security',
$security_model,
], ' '),
require => Class['::jenkins::cli_helper'],
require => Class['::jenkins::cli_helper'],
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
}
}
16 changes: 10 additions & 6 deletions manifests/user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -34,7 +34,7 @@
validate_string($full_name)
validate_string($public_key)
exec { "create-jenkins-user-${title}":
command => join([
command => join([
$::jenkins::cli_helper::helper_cmd,
'create_or_update_user',
$title,
Expand All @@ -43,17 +43,21 @@
"'${full_name}'",
"'${public_key}'",
], ' '),
require => Class['::jenkins::cli_helper'],
require => Class['::jenkins::cli_helper'],
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
}
}
'absent': {
exec { "delete-jenkins-user-${title}":
command => join([
command => join([
$::jenkins::cli_helper::helper_cmd,
'delete_user',
$title,
], ' '),
require => Class['::jenkins::cli_helper'],
require => Class['::jenkins::cli_helper'],
tries => $::jenkins::cli_tries,
try_sleep => $::jenkins::cli_try_sleep,
}
}
default: {
Expand Down

0 comments on commit 21dd8b5

Please sign in to comment.