Forum: CFEngine Help
Subject: copy_from symbolic links with link_type=none
Author: saweron
Link to topic: https://cfengine.com/forum/read.php?3,26584,26584#msg-26584
Hi,
Using cfengine 3.0.3
In our data repository, we have a collection of files which are mostly the same
on a lot of hosts. These files we've put into a MASTER directory. Next to this
directory we have directories named after hosts. In there we drop either files
or create a relative symlink pointing to the general file under the MASTER
directory
Example to illustrate:
ls MASTER/
ldapserver.xml
ls -l ldapserver/
lrwxrwxrwx 1 root root 20 Oct 6 2010 ldapserver.xml ->
../MASTER/ldapserver.xml
The corresponding policy uses to a customized copy_from body in which we set
link_type to none. We've found this trick in a forum post here
body copy_from copy_link(from)
{
source => "$(from)";
servers => { "${g.phost}" };
encrypt => "true";
trustkey => "true";
compare => "digest";
link_type => "none";
verify => "true";
purge => "true";
}
This works although I'm afraid this wasn't really envisioned. More recent
cf-agents on other hosts now start to complain as well:
Selection on rhs of lval 'link_type' given as 'none' is out of bounds, should
be in , near token 'none"'
My question: is there a cleaner/newer way to do the same i.e. copy the targets
of symlinks in the data repository au lieu the links themselves?
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine