From 2fb5223887992bf2f82d1e758ab02bf5a848e885 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 5 Sep 2026 10:54:04 +0100 Subject: [PATCH] Add a valkey cookbook --- .github/workflows/test-kitchen.yml | 1 + .kitchen.yml | 3 +++ cookbooks/valkey/metadata.rb | 8 +++++++ cookbooks/valkey/recipes/default.rb | 24 +++++++++++++++++++ test/integration/valkey/inspec/valkey_spec.rb | 13 ++++++++++ 5 files changed, 49 insertions(+) create mode 100644 cookbooks/valkey/metadata.rb create mode 100644 cookbooks/valkey/recipes/default.rb create mode 100644 test/integration/valkey/inspec/valkey_spec.rb diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 3c353a14f..d7cc60acf 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -111,6 +111,7 @@ jobs: - tilelog - tools - trac + - valkey - vectortile - web-cgimap - web-frontend diff --git a/.kitchen.yml b/.kitchen.yml index afe6028fa..bb7c066b6 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -441,6 +441,9 @@ suites: - name: trac run_list: - recipe[trac::default] + - name: valkey + run_list: + - recipe[valkey::default] - name: vectortile run_list: - recipe[vectortile::default] diff --git a/cookbooks/valkey/metadata.rb b/cookbooks/valkey/metadata.rb new file mode 100644 index 000000000..d8b76aa74 --- /dev/null +++ b/cookbooks/valkey/metadata.rb @@ -0,0 +1,8 @@ +name "valkey" +maintainer "OpenStreetMap Administrators" +maintainer_email "admins@openstreetmap.org" +license "Apache-2.0" +description "Installs and configures Valkey" + +version "1.0.0" +supports "ubuntu" diff --git a/cookbooks/valkey/recipes/default.rb b/cookbooks/valkey/recipes/default.rb new file mode 100644 index 000000000..ce68ef8f6 --- /dev/null +++ b/cookbooks/valkey/recipes/default.rb @@ -0,0 +1,24 @@ +# +# Cookbook:: valkey +# Recipe:: default +# +# Copyright:: 2026, OpenStreetMap Foundation +# +# 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 +# +# https://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. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package "valkey" + +service "valkey" do + action [:enable, :start] +end diff --git a/test/integration/valkey/inspec/valkey_spec.rb b/test/integration/valkey/inspec/valkey_spec.rb new file mode 100644 index 000000000..6067f116f --- /dev/null +++ b/test/integration/valkey/inspec/valkey_spec.rb @@ -0,0 +1,13 @@ +describe package("valkey-server") do + it { should be_installed } +end + +describe service("valkey") do + it { should be_enabled } + it { should be_running } +end + +describe port(6379) do + it { should be_listening } + its("protocols") { should cmp %w[tcp tcp6] } +end -- 2.47.3