I'm using CFEngine to deploy apache sites. So, I have a repository setup and my agents are copying files from it.
The trouble is when I'm editing my files using vim, it creates swap files. And they are copied to the server, which is bad because everytime I'm firing up my editor, all these machines download the swap files.
The big problem is that this triggers the restart of apache.
TLDR: how do I tell CFEngine to ignore files matching \..*\.swp
?
Here's what I have right now:
files:
"/etc/apache2/sites-available/"
handle => "apache-sites-available",
depends_on => { "apacheinstall" },
create => "true",
copy_from => secure_cp("/srv/repos/apache2/conf/sites-available/","$(sys.policy_hub)"),
depth_search => recurse("inf"),
classes => satisfied("apachemustrestart");
"/etc/apache2/sites-enabled/"
handle => "apache-sites-enabled",
depends_on => { "apacheinstall", "apache-sites-available" },
create => "true",
copy_from => secure_cp("/srv/repos/apache2/conf/sites-enabled/","$(sys.policy_hub)"),
depth_search => recurse("inf"),
classes => satisfied("apachemustrestart");
# promise_repaired => { "apachemustrestart" };
services:
"apache2"
handle => "apacheenable",
depends_on => { "apache-sites-enabled" },
service_policy => "start";
apachemustrestart::
"apache2"
service_policy => "restart";
Here's the satisfied
class
body classes satisfied(x)
{
promise_repaired => { "$(x)" };
# persist_time => "0";
}
Edit: My post was not precise enough.