From 1c6bf343867b816ea4f6f492498755556301434d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sat, 11 Apr 2026 19:16:19 +0400 Subject: [PATCH] Upgrade rskj to v9.0.1 and Ubuntu 24.04 --- site-cookbooks/kosmos_rsk/Berksfile | 5 ++++- site-cookbooks/kosmos_rsk/attributes/default.rb | 2 +- site-cookbooks/kosmos_rsk/kitchen.yml | 4 ++-- site-cookbooks/kosmos_rsk/metadata.rb | 2 +- site-cookbooks/kosmos_rsk/recipes/rskj.rb | 13 +++++++++++-- .../kosmos_rsk/templates/rskj-preseed.cfg.erb | 2 +- .../kosmos_rsk/test/integration/rskj/rskj_test.rb | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/site-cookbooks/kosmos_rsk/Berksfile b/site-cookbooks/kosmos_rsk/Berksfile index 8206ad0..5f92c96 100644 --- a/site-cookbooks/kosmos_rsk/Berksfile +++ b/site-cookbooks/kosmos_rsk/Berksfile @@ -1,5 +1,8 @@ source 'https://supermarket.chef.io' -cookbook 'kosmos-nginx', path: '../../site-cookbooks/kosmos-nginx' +cookbook 'kosmos_openresty', path: '../../site-cookbooks/kosmos_openresty' +cookbook 'kosmos-base', path: '../../site-cookbooks/kosmos-base' +cookbook 'openresty', path: '../../site-cookbooks/openresty' +cookbook 'kosmos-postfix', path: '../../site-cookbooks/kosmos-postfix' metadata diff --git a/site-cookbooks/kosmos_rsk/attributes/default.rb b/site-cookbooks/kosmos_rsk/attributes/default.rb index ae59908..6049a5e 100644 --- a/site-cookbooks/kosmos_rsk/attributes/default.rb +++ b/site-cookbooks/kosmos_rsk/attributes/default.rb @@ -1,4 +1,4 @@ -node.default['rskj']['version'] = '7.0.0~jammy' +node.default['rskj']['version'] = '9.0.1~noble' node.default['rskj']['network'] = 'testnet' node.default['rskj']['nginx']['domain'] = nil diff --git a/site-cookbooks/kosmos_rsk/kitchen.yml b/site-cookbooks/kosmos_rsk/kitchen.yml index 01cca76..28f774b 100644 --- a/site-cookbooks/kosmos_rsk/kitchen.yml +++ b/site-cookbooks/kosmos_rsk/kitchen.yml @@ -34,9 +34,9 @@ verifier: name: inspec platforms: - - name: ubuntu-22.04 + - name: ubuntu-24.04 driver: - image: dokken/ubuntu-22.04 + image: dokken/ubuntu-24.04 privileged: true pid_one_command: /usr/lib/systemd/systemd intermediate_instructions: diff --git a/site-cookbooks/kosmos_rsk/metadata.rb b/site-cookbooks/kosmos_rsk/metadata.rb index 6065952..a617641 100644 --- a/site-cookbooks/kosmos_rsk/metadata.rb +++ b/site-cookbooks/kosmos_rsk/metadata.rb @@ -3,7 +3,7 @@ maintainer 'Kosmos Developers' maintainer_email 'ops@kosmos.org' license 'MIT' description 'Installs/configures RSKj and related software' -version '0.4.0' +version '0.5.0' chef_version '>= 18.2' issues_url 'https://gitea.kosmos.org/kosmos/chef/issues' source_url 'https://gitea.kosmos.org/kosmos/chef' diff --git a/site-cookbooks/kosmos_rsk/recipes/rskj.rb b/site-cookbooks/kosmos_rsk/recipes/rskj.rb index 4299b00..3008473 100644 --- a/site-cookbooks/kosmos_rsk/recipes/rskj.rb +++ b/site-cookbooks/kosmos_rsk/recipes/rskj.rb @@ -20,10 +20,19 @@ apt_repository 'rskj' do end apt_package 'openjdk-17-jdk' +apt_package 'debconf-utils' + +execute 'preseed-rskj-license' do + command 'echo "rskj shared/accepted-rsk-license-v1-1 boolean true" | debconf-set-selections' + not_if 'debconf-get-selections | grep -q "shared/accepted-rsk-license-v1-1.*true"' +end + +execute 'preseed-rskj-config' do + command "echo \"rskj shared/config select #{node['rskj']['network']}\" | debconf-set-selections" + not_if "debconf-get-selections | grep -q \"shared/config.*#{node['rskj']['network']}\"" +end apt_package 'rskj' do - response_file 'rskj-preseed.cfg.erb' - response_file_variables network: node['rskj']['network'] options '--assume-yes' version node['rskj']['version'] end diff --git a/site-cookbooks/kosmos_rsk/templates/rskj-preseed.cfg.erb b/site-cookbooks/kosmos_rsk/templates/rskj-preseed.cfg.erb index 28c9efe..d0b825b 100644 --- a/site-cookbooks/kosmos_rsk/templates/rskj-preseed.cfg.erb +++ b/site-cookbooks/kosmos_rsk/templates/rskj-preseed.cfg.erb @@ -1,6 +1,6 @@ #_preseed_V1 # Do you agree to the terms of the applicable licenses? -rskj shared/accepted-rsk-license-v1-1 select true +rskj shared/accepted-rsk-license-v1-1 boolean true # Choose a configuration environment to run your node. # Choices: mainnet, testnet, regtest rskj shared/config select <%= @network %> diff --git a/site-cookbooks/kosmos_rsk/test/integration/rskj/rskj_test.rb b/site-cookbooks/kosmos_rsk/test/integration/rskj/rskj_test.rb index aec46de..0b9173f 100644 --- a/site-cookbooks/kosmos_rsk/test/integration/rskj/rskj_test.rb +++ b/site-cookbooks/kosmos_rsk/test/integration/rskj/rskj_test.rb @@ -9,7 +9,7 @@ end describe package('rskj') do it { should be_installed } - its('version') { should eq '7.0.0~jammy' } + its('version') { should eq '9.0.1~noble' } end describe service('rsk') do