From 236965e4973b0b4656ab9501ee11a3da063f9b8e Mon Sep 17 00:00:00 2001 From: Tube <7u83@mail.ru> Date: Tue, 14 Nov 2023 19:45:58 +0100 Subject: [PATCH] Bundle to create bind mounts --- lib.cf | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib.cf b/lib.cf index 0ed67c2..06d4f40 100644 --- a/lib.cf +++ b/lib.cf @@ -369,3 +369,27 @@ reports: } +bundle edit_line bind_mount(src,dst) +{ +insert_lines: + freebsd:: + "$(src) $(dst) nullfs rw,late 0 0"; + centos:: + "$(src) $(dst) none defaults,bind 0 0"; + +} + +bundle agent bind_mount(src,dst) +{ + +files: + "/etc/fstab" + edit_line => bind_mount("$(src)","$(dst)"), + classes => if_repaired(bind_mount_fstab_changed); +commands: + bind_mount_fstab_changed:: + "echo '$(src)$(dst)' > /dev/null && mount" + contain=>wmde_cmd_useshell, + args => "-a"; +} +