5 # Copyright:: 2023, OpenStreetMap Foundation
 
   7 # Licensed under the Apache License, Version 2.0 (the "License");
 
   8 # you may not use this file except in compliance with the License.
 
   9 # You may obtain a copy of the License at
 
  11 #     https://www.apache.org/licenses/LICENSE-2.0
 
  13 # Unless required by applicable law or agreed to in writing, software
 
  14 # distributed under the License is distributed on an "AS IS" BASIS,
 
  15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  16 # See the License for the specific language governing permissions and
 
  17 # limitations under the License.
 
  27 ruby_block "subuid-containers" do
 
  29     File.open("/etc/subuid", "a") do |file|
 
  30       file.puts("containers:2147483647:2147483648")
 
  33   not_if "grep -q '^containers:' /etc/subuid"
 
  36 ruby_block "subgid-containers" do
 
  38     File.open("/etc/subgid", "a") do |file|
 
  39       file.puts("containers:2147483647:2147483648")
 
  42   not_if "grep -q '^containers:' /etc/subgid"
 
  45 systemd_timer "podman-auto-update-frequency" do
 
  46   timer "podman-auto-update"
 
  49   on_unit_inactive_sec "20m"
 
  50   randomized_delay_sec "5m"
 
  53 service "podman-auto-update.timer" do
 
  54   action [:enable, :start]
 
  57 systemd_service "podman-system-prune" do
 
  58   description "Cleanup up unused podman images and containers"
 
  59   exec_start "/usr/bin/podman system prune --all --force"
 
  62 systemd_timer "podman-system-prune" do
 
  63   description "Cleanup up unused podman images and containers"
 
  65   on_unit_active_sec "7d"
 
  68 service "podman-system-prune.timer" do
 
  69   action [:enable, :start]