Forum: CFEngine Help Subject: Re: linking file if source exist Author: stchesmeli Link to topic: https://cfengine.com/forum/read.php?3,24513,24514#msg-24514
Ok i have fond by myself :) If that can help someone (this is just the code for my link problem, my apache bundle has more functionality). bundle common my_server_conf { vars: "apache_mods" slist => { "alias", "auth_basic", "authn_file", "authz_default", "authz_groupfile", "authz_host", "authz_user", "autoindex", "cgid", "cgi", "deflate", "dir", "env", "fastcgi", "mime", "mod-security", "negotiation", "reqtimeout", "setenvif", "status", "unique_id" }; } bundle agent set_apache_conf { vars: "mods" slist => { @(my_server_conf.apache_mods) }; classes: "c_$(mods)" expression => fileexists ("/etc/apache2/mods-available/$(mods).conf"); files: "/etc/apache2/mods-enabled/$(mods).load" comment => "Activate apache modules", link_from => ln_s("/etc/apache2/mods-available/$(mods).load"); "/etc/apache2/mods-enabled/$(mods).conf" ifvarclass => "c_$(mods)", comment => "Activate apache modules configuration", link_from => ln_s("/etc/apache2/mods-available/$(mods).conf"); } _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine