aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2023-04-01 15:58:08 +0200
committeralex <alex@pdp7.net>2023-04-01 15:58:08 +0200
commit77e3435742fb9f05f290ce08b93fda42aa560a2a (patch)
tree036ad53e7a9b3f9e6426a375456e640108223604
parentcaa593ee7526d74bea1d2a96dbc15bb661feed44 (diff)
Add Podman support
-rw-r--r--personal_infra/puppet/modules/podman/manifests/init.pp17
1 files changed, 17 insertions, 0 deletions
diff --git a/personal_infra/puppet/modules/podman/manifests/init.pp b/personal_infra/puppet/modules/podman/manifests/init.pp
new file mode 100644
index 00000000..17247aa2
--- /dev/null
+++ b/personal_infra/puppet/modules/podman/manifests/init.pp
@@ -0,0 +1,17 @@
+class podman($user, $storage_driver) {
+ package {'podman':}
+
+ file {['/etc/subuid', '/etc/subgid']:
+ content => "${user}:100000:65536\n",
+ }
+
+ exec {"/usr/bin/sed -i 's/driver = \".*\"/driver = \"${storage_driver}\"/g' /etc/containers/storage.conf":
+ require => Package['podman'],
+ unless => "/usr/bin/grep 'driver = \"${storage_driver}\"' /etc/containers/storage.conf",
+ }
+
+ exec {"/usr/bin/sed -i 's|#mount_program = \"/usr/bin/fuse-overlayfs\"|mount_program = \"/usr/bin/fuse-overlayfs\"|g' /etc/containers/storage.conf":
+ require => Package['podman'],
+ unless => "/usr/bin/grep '^#mount_program = \"/usr/bin/fuse-overlayfs\"'",
+ }
+}