Skip to content

Loading…

Fixing two issues in jenkins::config #1

Merged
merged 2 commits into from

3 participants

@thomasbiddle

1) For the Debian family (Checked Debian Wheezy and Ubuntu Precise) the defaults folder is in /etc/default instead of /etc/defaults
2) Removed prefixing of JENKINS_ on each variable as it removes flexibilty. If a user wants to add that - they can. This now enables me to set things like
HTTP_PORT correctly. Also - as a word of caution, file_line adds new resources to the end of the file - This may cause issues (For example, if HTTP_PORT is set after
JENKINS_ARGS then HTTP_PORT will not actually be read in, as JENKINS_ARGS calls it.

Tested on Ubuntu Precise 12.04 (Only checked the default part on Wheezy, didn't test - Can't imagine it being any different though)

class { 'jenkins':
  config_hash => {
    'HTTP_PORT' => { 'value' => 2222 }
  }
}

Was applied to my test node successfully.

Tested and fixed a few issues with rtyler/puppet-jenkins#54

@thomasbiddle thomasbiddle Fixing two issues in jenkins::config
1) For the Debian family (Checked Debian Wheezy and Ubuntu Precise) the defaults folder is in /etc/default instead of /etc/defaults
2) Removed prefixing of JENKINS_ on each variable as it removes flexibilty. If a user wants to add that - they can. This now enables me to set things like
HTTP_PORT correctly. Also - as a word of caution, file_line adds new resources to the end of the file - This may cause issues (For example, if HTTP_PORT is set after
JENKINS_ARGS then HTTP_PORT will not actually be read in, as JENKINS_ARGS calls it.

Tested on Ubuntu Precise 12.04 (Only checked the default part on Wheezy, didn't test - Can't imagine it being any different though)

  class { 'jenkins':
    config_hash => {
      'HTTP_PORT' => { 'value' => 2222 }
    }
  }

Was applied to my test node successfully.
ae0903b
@buildhive

Jenkins » puppet-jenkins #3 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive

Jenkins » puppet-jenkins #4 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@thomasbiddle thomasbiddle Fixing Test (They were all due to linter erroring out on trailing whi…
…tespace)

All "errors" were caused by the linter giving an exit code on trailing white space. Went ahead and removed it
all - Also cleaned up as many warning as I could for lines > 80 - Left a few but as they're strings I'm not really sure
if forcing it under 80 would make it look any cleaner.
829cf25
@thomasbiddle

Alright - Verified that this repo's test suite is actually passing - It looks like the CloudBees job is failing on some other script it runs - Looks like the wget call it makes:

inflection@tjbiddle-ubuntu-vm:/tmp$ wget -q -P /scratch/hudson/rubies https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/ruby/ruby-1.8.7-p357-x86_64.zip
inflection@tjbiddle-ubuntu-vm:/tmp$ echo $?
8
@rtyler
Jenkins member

Wow thanks! Don't mind the BuildHive issue, I'm trying to get that resolved, it has nothing to do with the code.

@rtyler rtyler merged commit 4c7990f into jenkinsci:master
@thomasbiddle thomasbiddle deleted the thomasbiddle:jenkins_config_fix branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 19, 2013
  1. @thomasbiddle

    Fixing two issues in jenkins::config

    thomasbiddle committed
    1) For the Debian family (Checked Debian Wheezy and Ubuntu Precise) the defaults folder is in /etc/default instead of /etc/defaults
    2) Removed prefixing of JENKINS_ on each variable as it removes flexibilty. If a user wants to add that - they can. This now enables me to set things like
    HTTP_PORT correctly. Also - as a word of caution, file_line adds new resources to the end of the file - This may cause issues (For example, if HTTP_PORT is set after
    JENKINS_ARGS then HTTP_PORT will not actually be read in, as JENKINS_ARGS calls it.
    
    Tested on Ubuntu Precise 12.04 (Only checked the default part on Wheezy, didn't test - Can't imagine it being any different though)
    
      class { 'jenkins':
        config_hash => {
          'HTTP_PORT' => { 'value' => 2222 }
        }
      }
    
    Was applied to my test node successfully.
  2. @thomasbiddle

    Fixing Test (They were all due to linter erroring out on trailing whi…

    thomasbiddle committed
    …tespace)
    
    All "errors" were caused by the linter giving an exit code on trailing white space. Went ahead and removed it
    all - Also cleaned up as many warning as I could for lines > 80 - Left a few but as they're strings I'm not really sure
    if forcing it under 80 would make it look any cleaner.
View
10 manifests/config.pp
@@ -3,11 +3,13 @@
# Hash with config options to set in sysconfig/jenkins defaults/jenkins
#
# Example use
-#
-# class{ 'jenkins::config':
-# config_hash => { 'PORT' => { 'value' => '9090' }, 'AJP_PORT' => { 'value' => '9009' } }
+#
+# class{ 'jenkins::config':
+# config_hash => {
+# 'PORT' => { 'value' => '9090' }, 'AJP_PORT' => { 'value' => '9009' }
+# }
# }
-#
+#
class jenkins::config(
$config_hash = {},
) {
View
26 manifests/init.pp
@@ -17,18 +17,20 @@
# Hash with config options to set in sysconfig/jenkins defaults/jenkins
#
# Example use
-#
-# class{ 'jenkins::config':
-# config_hash => { 'PORT' => { 'value' => '9090' }, 'AJP_PORT' => { 'value' => '9009' } }
+#
+# class{ 'jenkins::config':
+# config_hash => {
+# 'PORT' => { 'value' => '9090' }, 'AJP_PORT' => { 'value' => '9009' }
+# }
# }
-#
+#
# plugin_hash = undef (Default)
# Hash with config plugins to install
#
# Example use
-#
-# class{ 'jenkins::plugins':
-# plugin_hash => {
+#
+# class{ 'jenkins::plugins':
+# plugin_hash => {
# 'git' -> { version => '1.1.1' },
# 'parameterized-trigger' => {},
# 'multiple-scms' => {},
@@ -36,11 +38,11 @@
# 'token-macro' => {},
# }
# }
-#
+#
# OR in Hiera
-#
+#
# jenkins::plugin_hash:
-# 'git':
+# 'git':
# version: 1.1.1
# 'parameterized-trigger': {}
# 'multiple-scms': {}
@@ -48,8 +50,8 @@
# 'token-macro': {}
#
class jenkins(
- $version = 'installed',
- $lts = 0,
+ $version = 'installed',
+ $lts = 0,
$repo = 1,
$config_hash = undef,
$plugin_hash = undef,
View
2 manifests/plugin/install.pp
@@ -1,3 +1,5 @@
+# Define: jenkins::plugin::install
+#
define jenkins::plugin::install($version=0) {
$plugin = "${name}.hpi"
$plugin_parent_dir = '/var/lib/jenkins'
View
2 manifests/plugins.pp
@@ -1,3 +1,5 @@
+# Class: jenkins::plugins
+#
class jenkins::plugins (
$plugin_hash = {}
) {
View
2 manifests/repo/debian.pp
@@ -1,3 +1,5 @@
+# Class: jenkins::repo::debian
+#
class jenkins::repo::debian ( $lts=0 )
{
View
2 manifests/repo/el.pp
@@ -1,3 +1,5 @@
+# Class: jenkins::repo::el
+#
class jenkins::repo::el ( $lts=0 )
{
View
2 manifests/service.pp
@@ -1,3 +1,5 @@
+# Class: jenkins::service
+#
class jenkins::service {
service { 'jenkins':
ensure => running,
View
4 manifests/slave.pp
@@ -1,7 +1,9 @@
# Class: jenkins::slave
#
#
-# ensure is not immplemented yet, since i'm assuming you want to actually run the slave by declaring it..
+# ensure is not immplemented yet, since i'm
+# assuming you want to actually run the slave
+# by declaring it..
#
class jenkins::slave (
$masterurl = undef,
View
8 manifests/sysconfig.pp
@@ -1,14 +1,16 @@
+# Class: jenkins::sysconfig
+#
define jenkins::sysconfig ( $value ) {
$path = $::osfamily ? {
RedHat => '/etc/sysconfig',
- Debian => '/etc/defaults',
+ Debian => '/etc/default',
default => fail( "Unsupported OSFamily ${::osfamily}" )
}
file_line { "Jenkins sysconfig setting ${name}":
path => "${path}/jenkins",
- line => "JENKINS_${name}=\"${value}\"",
- match => "^JENKINS_${name}=",
+ line => "${name}=\"${value}\"",
+ match => "^${name}=",
}
}
Something went wrong with that request. Please try again.