-
Notifications
You must be signed in to change notification settings - Fork 24
/
createlinks
executable file
·315 lines (260 loc) · 8.33 KB
/
createlinks
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
#!/usr/bin/perl -w
#
# Copyright (C) 2012 Nethesis S.r.l.
# http://www.nethesis.it - [email protected]
#
# This script is part of NethServer.
#
# NethServer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or any later version.
#
# NethServer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NethServer. If not, see <http://www.gnu.org/licenses/>.
#
use esmith::Build::CreateLinks qw(:all);
use File::Path;
event_actions('trusted-networks-modify', qw(
firewall-adjust 94
));
#--------------------------------------------------
# actions for nethserver-base-update event
#--------------------------------------------------
event_actions('nethserver-base-update', qw(
initialize-default-databases 00
nethserver-base-selinux-setup 10
nethserver-base-conf 40
nethserver-base-mail-aliases 50
nethserver-base-fixrepos 98
));
event_templates('nethserver-base-update', qw(
/etc/hosts
/etc/resolv.conf
/etc/selinux/config
/etc/sudoers
/etc/shells
/etc/logviewer.conf
/etc/logrotate.conf
/etc/backup-config.d/nethserver-certificates.include
/etc/yum.conf
/etc/yum/yum-cron.conf
/etc/cron.hourly/jobs.deny
/etc/yum/vars/nsrelease
/etc/nethserver/eorepo.conf
/etc/nethserver/pkginfo.conf
));
event_services('nethserver-base-update', qw(
systemd-udevd restart
));
#--------------------------------------------------
# actions for interface-update event #1532
#--------------------------------------------------
event_actions('interface-update', qw(
network-stop 04
interface-rename 20
adjust-fixnetwork-flag 21
interface-config-reset 25
interface-config-write 30
network-start 70
static-routes-save 80
firewall-adjust 90
trusted-networks-modify 95
));
event_templates('interface-update', qw(
/etc/modprobe.d/bonding.conf
/etc/sysconfig/network
/etc/hosts
/etc/resolv.conf
));
#--------------------------------------------------
# Refs #939 tcp/udp port server validator
#--------------------------------------------------
validator_actions('remote-port', qw(
open-tcp-connection 10
));
#--------------------------------------------------
# Refs #1038 expand /etc/hosts template on host
# events -- FIXME: should be moved into
# nethserver-hosts package (?)
#--------------------------------------------------
templates2events('/etc/hosts', qw(
host-create
host-delete
host-modify
));
#--------------------------------------------------
# empty events:
#--------------------------------------------------
foreach (qw(
)) {
File::Path::make_path('root/etc/e-smith/events/' . $_);
}
#--------------------------------------------------
# actions for system-init event
#--------------------------------------------------
event_actions('system-init', qw(
initialize-default-databases 00
nethserver-base-initialize-db 50
nethserver-generate-certificate 55
system-adjust 90
nethserver-base-interface-update 95
nethserver-system-init-clear 98
));
#
# certificate-update event
#
templates2events('/etc/backup-config.d/nethserver-certificates.include', 'certificate-update');
#
# profile-modify event
#
event_actions('profile-modify', qw(
nethserver-base-mail-aliases 30
));
event_services('profile-modify', qw(
postfix reload
));
#--------------------------------------------------
# actions for migration-import event
#--------------------------------------------------
$event = "migration-import";
event_actions($event, 'nethserver-base-migrate' => 20);
#--------------------------------------------------
# actions for firewall-adjust event
#--------------------------------------------------
$event = "firewall-adjust";
event_actions($event, 'firewall-adjust' => 20);
#--------------------------------------------------
# actions for runlevel-adjust event
#--------------------------------------------------
$event = "runlevel-adjust";
event_actions($event, 'runlevel-adjust' => 20);
#
# hostname-modify event (#1878)
#
event_templates('hostname-modify', qw(
/etc/sysconfig/network
));
event_actions('hostname-modify', qw(
system-adjust 96
));
#
# Validator for log file names (#470)
#
validator_actions('logfile', qw(
logfile 10
));
#
# Validator for network configuration consistency (#2103)
#
validator_actions('interface-config', qw(
interface-role 10
));
#--------------------------------------------------
# password-modify event
#--------------------------------------------------
event_actions('password-modify', qw(
password-set 25
password-cleanup 90
));
#--------------------------------------------------
# validate passwords
#--------------------------------------------------
validator_actions('password-strength',
'password-strength' => '10');
#--------------------------------------------------
# actions for static-routes-save event
#--------------------------------------------------
$event = "static-routes-save";
event_actions($event, qw(
network-route-down 15
interface-config-write 25
network-route-up 35
));
#--------------------------------------------------
# Refs #3272 uniq key networks db validator
#--------------------------------------------------
validator_actions('network-create', qw(
uniq-networksdb-key 20
));
#
# system-shutdown event
#
event_actions('system-shutdown', qw(
system-shutdown 20
));
#--------------------------------------------------
# actions for certificate-upload event
#--------------------------------------------------
$event = "certificate-upload";
event_actions($event, qw(
nethserver-certificate-upload 03
));
templates2events('/etc/backup-config.d/nethserver-certificates.include', $event);
#--------------------------------------------------
# validate pem certificate
#--------------------------------------------------
validator_actions('pem-certificate',
'pem-certificate' => '10');
#--------------------------------------------------
# validate rsa key
#--------------------------------------------------
validator_actions('rsa-key',
'rsa-key' => '10');
#--------------------------------------------------
# check the certificate compatibility with
# current TLS policy
#--------------------------------------------------
validator_actions('tlspolicy-safetyguard', qw(
tlspolicy-ecdsa-cert 10
));
#--------------------------------------------------
# actions for proxy-modify event
#--------------------------------------------------
event_templates('proxy-modify', qw(
/etc/yum.conf
/etc/profile.d/nethserver_proxy.sh
));
validator_actions('myhostname', qw(
hostname-length 10
hostname-localhost 20
));
event_actions('post-restore-config', qw(
hostname-set 01
));
#--------------------------------------------------
# actions for software-repos-save event
#--------------------------------------------------
event_actions('software-repos-save', qw(
nethserver-base-software-repos 20
nethserver-base-import-repokeys 21
));
event_templates('software-repos-save', qw(
/etc/yum/vars/nsrelease
/etc/nethserver/eorepo.conf
/etc/nethserver/pkginfo.conf
/etc/yum/yum-cron.conf
));
#--------------------------------------------------
# actions for software-repos-upgrade event
#--------------------------------------------------
event_actions('software-repos-upgrade', qw(
nethserver-base-distro-upgrade 20
));
#
# pre-restore-config event
#
event_actions('pre-restore-config', qw(
nethserver-base-restore-yumrepos 20
));
#--------------------------------------------------
# actions for notifications-save event
#--------------------------------------------------
event_actions('notifications-save', qw(
nethserver-base-mail-aliases 50
));