Pārlūkot izejas kodu

fix(podman): Add sysctl for podman

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 2 gadi atpakaļ
vecāks
revīzija
3db260a835

+ 17 - 0
cookbooks/podman/recipes/_sysctl.rb

@@ -0,0 +1,17 @@
+#
+# Cookbook:: podman
+# Recipe:: default
+#
+# Copyright:: 2022, The Authors, All Rights Reserved.
+
+sysctl 'kernel.unprivileged_userns_clone' do
+  value 1
+  comment 'Allow ns creation'
+  only_if { ::File.exists?('/proc/sys/kernel/unprivileged_userns_clone') }
+end
+
+sysctl 'net.ipv4.ping_group_range' do
+  value '0 2000000'
+  comment 'Enable unprivileged ping'
+  not_if { node['virtualization']['system'] }
+end

+ 1 - 0
cookbooks/podman/recipes/default.rb

@@ -7,6 +7,7 @@
 
 include_recipe 'podman::_repository'
 include_recipe 'podman::_packages'
+include_recipe 'podman::_sysctl'
 
 # Specific to WSL2:
 # Ref: https://www.redhat.com/sysadmin/podman-windows-wsl2