forked from cfengine/masterfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
promises.cf
148 lines (115 loc) · 4.84 KB
/
promises.cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
###############################################################################
#
# promises.cf - Basic Policy for CFEngine
#
###############################################################################
body common control
{
bundlesequence => {
# Common bundle first (Best Practice)
"def",
"cfe_internal_hub_vars",
# Design Center
"cfsketch_run",
# Agent bundle
"cfe_internal_management", # See cfe_internal/CFE_cfengine.cf
"service_catalogue",
"example_use_goals", # See cfe_internal/example_use_goals.cf
};
inputs => {
# File definition for global variables and classes
"def.cf",
# Design Center
# MARKER FOR CF-SKETCH INPUT INSERTION
"sketches/meta/api-runfile.cf",
@(cfsketch_g.inputs),
# CFEngine internal processes for Mission Portal mostly
"cfe_internal/CFE_cfengine.cf",
"cfe_internal/CFE_hub_specific.cf",
"cfe_internal/CFE_knowledge.cf",
"cfe_internal/example_use_goals.cf",
# Control body for all CFEngine robot agents
"controls/cf_agent.cf",
"controls/cf_execd.cf",
"controls/cf_hub.cf",
"controls/cf_monitord.cf",
"controls/cf_runagent.cf",
"controls/cf_serverd.cf",
# COPBL/Custom libraries. Eventually this should use wildcards.
@(cfengine_stdlib.inputs),
# Add update files to build Knowledge Map relationship
"update/update_bins.cf",
"update/update_policy.cf",
"update/update_processes.cf",
# List of services here
"services/init_msg.cf",
"services/file_change.cf",
};
version => "CFEngine Promises.cf 3.6.0";
# goal_categories => { "goals", "targets", "milestones" };
# goal_patterns => { "goal_.*", "target.*","milestone.*" };
cfengine_internal_rotate_logs::
# CFEngine generates internal log files that need to be rotated.
# Have a look at def.cf to enable rotation of these files
"rotate_promise_summary" usebundle => logrotate("@(def.cfe_log_files)", "1m", "10"),
comment => "Rotate log files once their size reach 1MB, keep 10 versions";
"rotate_outputs" usebundle => prunedir("@(def.cfe_log_dirs)", "30"),
comment => "Delete outputs/* files older than 30 days";
}
bundle common cfengine_stdlib
{
vars:
cfengine_3_4::
"inputs" slist => { "libraries/cfengine_stdlib.cf" };
cfengine_3_5::
"inputs" slist => {
"lib/3.5/paths.cf",
"lib/3.5/common.cf",
"lib/3.5/commands.cf",
"lib/3.5/packages.cf",
"lib/3.5/files.cf",
"lib/3.5/services.cf",
"lib/3.5/processes.cf",
"lib/3.5/storage.cf",
"lib/3.5/databases.cf",
"lib/3.5/monitor.cf",
"lib/3.5/guest_environments.cf",
"lib/3.5/bundles.cf",
};
!(cfengine_3_4||cfengine_3_5)::
"inputs" slist => {
"$(sys.local_libdir)/paths.cf",
"$(sys.local_libdir)/common.cf",
"$(sys.local_libdir)/commands.cf",
"$(sys.local_libdir)/packages.cf",
"$(sys.local_libdir)/files.cf",
"$(sys.local_libdir)/services.cf",
"$(sys.local_libdir)/processes.cf",
"$(sys.local_libdir)/storage.cf",
"$(sys.local_libdir)/databases.cf",
"$(sys.local_libdir)/monitor.cf",
"$(sys.local_libdir)/guest_environments.cf",
"$(sys.local_libdir)/bundles.cf",
};
reports:
verbose_mode::
"$(this.bundle): defining inputs='$(inputs)'";
}
###############################################################################
#
# bundle agent service_catalogue
# - general purposes of usage
#
###############################################################################
bundle agent service_catalogue
{
methods:
any::
"security" -> { goal_infosec, goal_compliance }
comment => "Basic change management",
handle => "service_catalogue_change_management",
usebundle => change_management;
"INIT MSG" usebundle => init_msg,
comment => "Just a pre-defined policy bundled with the package",
handle => "main_methods_any_init_msg";
}