Is there a way to define hardlinks inside puppet manifest?
It seems file type can only define symbolic links, but I need it to be hard links in order to make some of my chrooted applications to work. For example, I need to hardlink
/etc/hosts -> $chroot/etc/hosts
/etc/resolvf.com -> $chroot/etc/resolv.conf
and so on.
What can be the simplest way to archive that?
Update: thanks, I've ended with following defines:
define hardlinkdir(source=$name, target) {
exec {
"hardlinkdir-$name":
command => "cp -r --link $target $source",
path => "/usr/bin:/bin",
creates => $source;
}
}
define hardlink(source=$name, target) {
exec {
"hardlink-$name":
command => "ln --force $target $source",
path => "/usr/bin:/bin",
unless => "test $source -ef $target";
}
}
Sure, they are not perfect, but they does the job and it's everything I need.
Thank you for your help!