diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03c312d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Gemfile.lock +.bundled_gems diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..2db9fcf --- /dev/null +++ b/Gemfile @@ -0,0 +1,31 @@ +source 'https://rubygems.org' + +group :development, :test do + gem 'puppetlabs_spec_helper', :require => false + + gem 'metadata-json-lint' + # This is nice and all, but let's not worry about it until we've actually + # got puppet 4.x sorted + # gem 'puppet-lint-param-docs' + gem 'puppet-lint-absolute_classname-check' + gem 'puppet-lint-absolute_template_path' + gem 'puppet-lint-trailing_newline-check' + + # Puppet 4.x related lint checks + gem 'puppet-lint-unquoted_string-check' + #The puppet-gerrit module makes too much use of empty string defaults + #so disable this check for now + #gem 'puppet-lint-empty_string-check' + gem 'puppet-lint-leading_zero-check' + gem 'puppet-lint-variable_contains_upcase' + gem 'puppet-lint-spaceship_operator_without_tag-check' + gem 'puppet-lint-undef_in_function-check' + + if puppetversion = ENV['PUPPET_GEM_VERSION'] + gem 'puppet', puppetversion, :require => false + else + gem 'puppet', '~> 3.0', :require => false + end +end + +# vim:ft=ruby diff --git a/manifests/cgroups.pp b/manifests/cgroups.pp index d878d79..4e9fa02 100644 --- a/manifests/cgroups.pp +++ b/manifests/cgroups.pp @@ -2,7 +2,7 @@ # class jenkins::cgroups { - include jenkins::params + include ::jenkins::params if ($::jenkins::params::cgroups_tools_package != '') { package { 'cgroups-tools': diff --git a/manifests/jenkinsuser.pp b/manifests/jenkinsuser.pp index c39b855..ddc3020 100644 --- a/manifests/jenkinsuser.pp +++ b/manifests/jenkinsuser.pp @@ -63,8 +63,8 @@ class jenkins::jenkinsuser( require => File['/home/jenkins/.ssh'], } ssh_authorized_key { '/home/jenkins/.ssh/authorized_keys': - ensure => absent, - user => 'jenkins', + ensure => absent, + user => 'jenkins', } #NOTE: not all distributions have default bash files in /etc/skel diff --git a/manifests/master.pp b/manifests/master.pp index 95e6d5f..5193d0c 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -13,8 +13,8 @@ class jenkins::master( $jenkins_ssh_private_key = '', $jenkins_ssh_public_key = '', ) { - include pip - include apt + include ::pip + include ::apt include ::httpd package { 'openjdk-7-jre-headless': @@ -123,11 +123,11 @@ class jenkins::master( } file { '/etc/default/jenkins': - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - source => 'puppet:///modules/jenkins/jenkins.default', + ensure => present, + owner => 'root', + group => 'root', + mode => '0644', + source => 'puppet:///modules/jenkins/jenkins.default', } file { '/var/lib/jenkins': diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ac1be8c..2d9b932 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -57,12 +57,12 @@ define jenkins::plugin( } exec { "download-${name}" : - command => "wget --no-check-certificate ${base_url}/${plugin}", - cwd => $plugin_dir, - require => File[$plugin_dir], - path => ['/usr/bin', '/usr/sbin',], - user => 'jenkins', - unless => "test -f ${plugin_dir}/${name}.?pi", + command => "wget --no-check-certificate ${base_url}/${plugin}", + cwd => $plugin_dir, + require => File[$plugin_dir], + path => ['/usr/bin', '/usr/sbin',], + user => 'jenkins', + unless => "test -f ${plugin_dir}/${name}.?pi", # OpenStack modification: don't auto-restart jenkins so we can control # outage timing better. # notify => Service['jenkins'], diff --git a/manifests/slave.pp b/manifests/slave.pp index cf9a2b8..9309df3 100644 --- a/manifests/slave.pp +++ b/manifests/slave.pp @@ -8,12 +8,12 @@ class jenkins::slave( $gerrituser = 'jenkins', ) { - include haveged - include pip - include jenkins::params + include ::haveged + include ::pip + include ::jenkins::params if ($user == true) { - class { 'jenkins::jenkinsuser': + class { '::jenkins::jenkinsuser': ensure => present, ssh_key => $ssh_key, gitfullname => $gitfullname, @@ -49,9 +49,9 @@ class jenkins::slave( if ($::operatingsystem != 'Fedora') { exec { 'update-java-alternatives': - unless => '/bin/ls -l /etc/alternatives/java | /bin/grep 1.7.0-openjdk', - command => '/usr/sbin/alternatives --set java /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java && /usr/sbin/alternatives --set javac /usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin/javac', - require => Anchor['jenkins::slave::update-java-alternatives'] + unless => '/bin/ls -l /etc/alternatives/java | /bin/grep 1.7.0-openjdk', + command => '/usr/sbin/alternatives --set java /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java && /usr/sbin/alternatives --set javac /usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin/javac', + require => Anchor['jenkins::slave::update-java-alternatives'] } } } @@ -80,9 +80,9 @@ class jenkins::slave( } exec { 'update-java-alternatives': - unless => "/bin/ls -l /etc/alternatives/java | /bin/grep java-7-openjdk-${::dpkg_arch}", - command => "/usr/sbin/update-java-alternatives --set java-1.7.0-openjdk-${::dpkg_arch}", - require => Anchor['jenkins::slave::update-java-alternatives'] + unless => "/bin/ls -l /etc/alternatives/java | /bin/grep java-7-openjdk-${::dpkg_arch}", + command => "/usr/sbin/update-java-alternatives --set java-1.7.0-openjdk-${::dpkg_arch}", + require => Anchor['jenkins::slave::update-java-alternatives'] } } default: {