From 14ea266c3b452a3545b2f16455a732a62a265934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Fri, 2 Dec 2022 08:03:04 -0800 Subject: [PATCH 1/6] Pin the Jenkins version to the last compatible version. This cookbook expects the package install of Jenkins to install with sysvinit style init scripts and configures jenkins with that assumption. Jenkins packages after 2.335 (weekly) and 2.332.1 (LTS) and on use systemd service units to manage the Jenkins service [1]. This cookbook has not yet been made compatible with these versions. This pull request is something of a straw man to get CI turning over again so I can start working on a new cookbook version that supports the current Jenkins packages. [1]: https://www.jenkins.io/blog/2022/03/25/systemd-migration/ --- attributes/master.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/attributes/master.rb b/attributes/master.rb index 0de26033e..e934d7a7e 100644 --- a/attributes/master.rb +++ b/attributes/master.rb @@ -39,7 +39,8 @@ # package version (from the yum or apt repo), or the version of the war # file to download from the Jenkins mirror. # - master['version'] = nil + # The current default is the last version of Jenkins which uses sysvinit scripts instead of systemd units. + master['version'] = 2.319.3 # # The "channel" to use, default is stable From f6b5c811075a628164b0063da6b765fb32af2918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Fri, 2 Dec 2022 08:10:25 -0800 Subject: [PATCH 2/6] Add a changelog entry. --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 268a37a3f..608c53347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,15 @@ This file is used to list changes made in each version of the jenkins cookbook. ## Unreleased +- Pin the last version of Jenkins LTS which uses sysvinit scripts that this cookbook expects. + ## 9.5.4 - *2022-12-08* -Standardise files with files in sous-chefs/repo-management +- Standardise files with files in sous-chefs/repo-management ## 9.5.3 - *2022-12-02* -Standardise files with files in sous-chefs/repo-management +- Standardise files with files in sous-chefs/repo-management ## 9.5.2 - *2022-03-28* From 001bd39ea7e6028baa578629a9f17932de4e609f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Fri, 2 Dec 2022 08:14:18 -0800 Subject: [PATCH 3/6] Quote version string. --- attributes/master.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attributes/master.rb b/attributes/master.rb index e934d7a7e..2c49c3d4b 100644 --- a/attributes/master.rb +++ b/attributes/master.rb @@ -40,7 +40,7 @@ # file to download from the Jenkins mirror. # # The current default is the last version of Jenkins which uses sysvinit scripts instead of systemd units. - master['version'] = 2.319.3 + master['version'] = '2.319.3' # # The "channel" to use, default is stable From a000687f41b87b350a21204f063005f808d1ec09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnaro=CC=88k?= Date: Fri, 2 Dec 2022 08:25:56 -0800 Subject: [PATCH 4/6] scratch! Try 3-space indent to satisfy mdlint. --- CHANGELOG.md | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 608c53347..6ee40b7a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,11 +58,11 @@ This file is used to list changes made in each version of the jenkins cookbook. ### Breaking Changes / Deprecations - `jenkins_jnlp_slave`: - - Renamed `runit_groups` property to `service_groups` - - New service created -- old Runit service will need manual cleanup + - Renamed `runit_groups` property to `service_groups` + - New service created -- old Runit service will need manual cleanup - `jenkins::_master_war`: - - New service created -- old Runit service will need manual cleanup + - New service created -- old Runit service will need manual cleanup ## 8.2.3 - *2021-03-25* @@ -519,23 +519,22 @@ This file is used to list changes made in each version of the jenkins cookbook. - Move testing instructions into contribution guidelines - Remove old TODO file - Refactor attributes into semantic groupings and namespaces - - - `jenkins.cli` has been removed - - `jenkins.java_home` has been changed to `jenkins.java` and accepts the full path to the java binary, not the JAVA_HOME - - `jenkins.iptables_allow` has been removed - - `jenkins.mirror` -> `jenkins.master.mirror` - - `jenkins.executor` created - - `jenkins.executor.timeout` created - - `jenkins.executor.private_key` created - - `jenkins.executor.proxy` created - - `jenkins.master` created and only refers to the Jenkins master installation - - `jenkins.master.source` created to refer to the full URL of the war download - - `jenkins.master.jvm_options` created - - `jenkins.master.jenkins_args` added - - `jenkins.master.url` -> `jenkins.master.endpoint` - - `jenkins.master.log_directory` created - - `jenkins.node` attributes have all been removed - - `jenkins.server` attributes have all been removed + - `jenkins.cli` has been removed + - `jenkins.java_home` has been changed to `jenkins.java` and accepts the full path to the java binary, not the JAVA_HOME + - `jenkins.iptables_allow` has been removed + - `jenkins.mirror` -> `jenkins.master.mirror` + - `jenkins.executor` created + - `jenkins.executor.timeout` created + - `jenkins.executor.private_key` created + - `jenkins.executor.proxy` created + - `jenkins.master` created and only refers to the Jenkins master installation + - `jenkins.master.source` created to refer to the full URL of the war download + - `jenkins.master.jvm_options` created + - `jenkins.master.jenkins_args` added + - `jenkins.master.url` -> `jenkins.master.endpoint` + - `jenkins.master.log_directory` created + - `jenkins.node` attributes have all been removed + - `jenkins.server` attributes have all been removed - Removed Chef MiniTest handler From 0ed4661220457bdcd217eb87c1404358a0c896a0 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Tue, 27 Dec 2022 15:32:03 -0800 Subject: [PATCH 5/6] Move service resource directly after package installation This ensures that we enable the service which will install the initrc stubs for systemd. This apparently is needed when running on an Ubuntu 22.04 host when testing. Signed-off-by: Lance Albertson --- recipes/_master_package.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/_master_package.rb b/recipes/_master_package.rb index 000713edb..8dda7fd06 100644 --- a/recipes/_master_package.rb +++ b/recipes/_master_package.rb @@ -51,6 +51,11 @@ version node['jenkins']['master']['version'] end +service 'jenkins' do + supports status: true, restart: true, reload: true + action [:enable, :start] +end + directory node['jenkins']['master']['home'] do owner node['jenkins']['master']['user'] group node['jenkins']['master']['group'] @@ -91,8 +96,3 @@ notifies :restart, 'service[jenkins]', :immediately end end - -service 'jenkins' do - supports status: true, restart: true, reload: true - action [:enable, :start] -end From 277b3075c9dd9c9177eb4770fa3a00521f587e39 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Tue, 27 Dec 2022 16:34:56 -0800 Subject: [PATCH 6/6] Use Chef 17 or lower due to multiple issues This cookbook needs a major refactor to have it work properly with Chef 18. Most of the issues are related to the use attributes referencing other attributes. For now, let's just get a release out with fixes and look into a major refactor later. Signed-off-by: Lance Albertson --- CHANGELOG.md | 1 + README.md | 4 ++-- kitchen.dokken.yml | 2 +- kitchen.yml | 1 + metadata.rb | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ee40b7a5..400a7f08a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This file is used to list changes made in each version of the jenkins cookbook. ## Unreleased - Pin the last version of Jenkins LTS which uses sysvinit scripts that this cookbook expects. +- Use Chef 17 or lower due to multiple issues ## 9.5.4 - *2022-12-08* diff --git a/README.md b/README.md index 06cd11f9c..43f94c04b 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,13 @@ This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of ### Platforms -- Debian 9+ +- Debian 10+ - Ubuntu 18.04+ - RHEL/CentOS 7+ ### Chef -- Chef 13.0+ +- Chef 13.0+, < 18.0 #### Java cookbook diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 7d10a541c..06dade37b 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -1,7 +1,7 @@ driver: name: dokken privileged: true # because Docker and SystemD - chef_version: <%= ENV['CHEF_VERSION'] || 'current' %> + chef_version: <%= ENV['CHEF_VERSION'] || '17' %> env: [CHEF_LICENSE=accept] ## Uncomment to allow access to the Jenkins webui which is useful when troubleshooting # ports: diff --git a/kitchen.yml b/kitchen.yml index a45738bb4..4fb42eb7d 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -1,5 +1,6 @@ driver: name: vagrant + chef_version: <%= ENV['CHEF_VERSION'] || '17' %> customize: cpus: 2 memory: 1024 diff --git a/metadata.rb b/metadata.rb index 5ef5c754a..5bda8eecc 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ version '9.5.4' source_url 'https://github.com/sous-chefs/jenkins' issues_url 'https://github.com/sous-chefs/jenkins/issues' -chef_version '>= 13.0' +chef_version '>= 13.0', '< 18.0' supports 'amazon' supports 'centos'