1 # Copyright (C) Cfengine AS
3 # This file is part of Cfengine 3 - written and maintained by Cfengine AS.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; version 3.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
18 # To the extent this program is licensed as part of the Enterprise
19 # versions of Cfengine, the applicable Commerical Open Source License
20 # (COSL) may apply to this file if you as a licensee so wish it. See
21 # included file COSL.txt.
24 # Just bodies and editbundles here
27 body perms p(user,mode)
30 owners => { "$(user)" };
33 body perms mog(mode,user,group)
36 owners => { "$(user)" };
37 groups => { "$(groups)" };
41 ############################################
43 body depth_search recurse(d)
49 #########################################################
54 dirlinks => "delete"; #keep/tidy/delete
55 rmdirs => "true"; #none/all/sub
58 #########################################################
60 body file_select days_old(days)
63 # we can build old "include", "exclude", and "ignore"
64 # from these as standard patterns - these bodies can
65 # form a library of standard patterns
69 mtime => irange(ago(1,0,0,0,0,0),ago(0,0,$(days),0,0,0));
70 file_result => "mtime";
73 #########################################################
75 body changes lay_trip_wire
79 report_changes => "content";
80 update_hashes => "yes";
83 ########################################################
87 ifelapsed => "240"; # run only every 4 hours
90 #######################################################
92 #######################################################
94 body edit_defaults def
96 empty_file_before_editing => "false";
97 edit_backup => "false";
98 max_file_size => "100000";
101 ########################################################
106 # If not line to match, applies to whole text body
107 before_after => "before";
110 ########################################################
112 bundle edit_line DeleteLinesMatching(regex)
121 ########################################################
125 action_policy => "warn";
129 ########################################################
131 bundle edit_line upgrade_cfexecd
135 "exec_fix" not => regline(".*cf-execd.*","$(edit.filename)");
141 "0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/sbin/cf-execd -F";
145 "cfexecd" replace_with => With("cf-execd");
151 "Added a 5 minute schedule to crontabs";
154 ########################################
156 ########################################
158 body replace_with With(x)
161 replace_value => "$(x)";
162 occurrences => "all";
165 ########################################
167 body copy_from scp(from,server)
176 body copy_from remote_copy(source, server) {
177 source => "$(source)";
178 servers => { "$(server)" };
181 copy_backup => "false";