-
Notifications
You must be signed in to change notification settings - Fork 8
/
createlinks
225 lines (188 loc) · 4.9 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
#!/usr/bin/perl
#
# Copyright (C) 2016 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 COPYING.
#
use strict;
use esmith::Build::CreateLinks qw(:all);
#
# event nethserver-sssd-update event
#
event_templates('nethserver-sssd-update', qw(
/etc/sssd/sssd.conf
/etc/krb5.conf
/etc/samba/smb.conf
/etc/openldap/ldap.conf
/etc/backup-config.d/nethserver-sssd.include
));
event_actions('nethserver-sssd-update', qw(
initialize-default-databases 00
));
event_services('nethserver-sssd-update', qw(
sssd restart
));
#
# event nethserver-sssd-save
#
event_templates('nethserver-sssd-save', qw(
/etc/sssd/sssd.conf
/etc/krb5.conf
/etc/samba/smb.conf
/etc/openldap/ldap.conf
/etc/backup-config.d/nethserver-sssd.include
));
event_actions('nethserver-sssd-save', qw(
nethserver-sssd-cleanup 01
nethserver-sssd-conf 20
nethserver-sssd-initkeytabs 30
nethserver-sssd-notifyclients 80
));
event_services('nethserver-sssd-save', qw(
sssd restart
));
#
# event nethserver-sssd-leave
#
event_actions('nethserver-sssd-leave', qw(
nethserver-sssd-leave 01
nethserver-sssd-cleanup 02
));
event_templates('nethserver-sssd-leave', qw(
/etc/samba/smb.conf
/etc/krb5.conf
));
validator_actions('ad-dns', qw(
srv_record 20
));
# actions for user-create validator
validator_actions('user-create', qw(
user-length 30
));
# actions for user-delete validator
validator_actions('user-delete', qw(
account-removable 20
));
# actions for group-create validator
validator_actions('group-create', qw(
group-length 30
));
# actions for group-delete validator
validator_actions('group-delete', qw(
account-removable 20
));
#------------------------------------------------------
# Clear SSSD cache at the end of all user/group events
#------------------------------------------------------
event_actions($_, qw(
nethserver-sssd-clear-cache 90
)) foreach(qw(
user-create
user-modify
user-delete
user-lock
user-unlock
group-create
group-modify
group-delete
));
#--------------------------------------------------------
# Clear SSSD before password-policy-update extra actions
#--------------------------------------------------------
event_actions('password-policy-update', qw(
nethserver-sssd-clear-cache 10
));
# actions for myhostname validator
validator_actions('myhostname', qw(
failifjoin 00
));
#--------------------------------------------------
# actions for post-restore-config event
#--------------------------------------------------
event_actions('post-restore-config', qw(
nethserver-sssd-restore-ns6hostname 00
nethserver-sssd-restore-tdb 40
nethserver-sssd-conf 50
nethserver-sssd-set-workgroup 50
nethserver-sssd-clear-cache 71
));
#--------------------------------------------------
# actions for pre-backup-config event
#--------------------------------------------------
event_actions('pre-backup-config', qw(
nethserver-sssd-backup-tdb 40
));
event_templates('pre-backup-config', qw(
/etc/backup-config.d/nethserver-sssd.include
));
#--------------------------------------------------
# actions for nethserver-sssd-remove-provider event
#--------------------------------------------------
event_actions('nethserver-sssd-remove-provider', qw(
nethserver-sssd-export-accounts 20
nethserver-sssd-remove-provider 40
));
#
# dcipaddr validator
#
validator_actions('dcipaddr', qw(
ipgreenandbridged 20
green-dhcp 30
));
#
# ldap probe validator
#
validator_actions('ldap-probe', qw(
ldap-check-connect 20
));
#
# migration-import event
#
event_actions('migration-import', qw(
nethserver-sssd-migrate 20
));
validator_actions('dcrealm', qw(
differhostname 20
));
# actions for group-create validator
validator_actions('ldap-credentials', qw(
ldaptestbind 20
));
#
# post-restore-data event
#
event_actions('post-restore-data', qw(
nethserver-sssd-ns6homes 60
));
#
# nethserver-directory-ns6upgrade
#
event_actions('nethserver-directory-ns6upgrade', qw(
nethserver-sssd-ns6homes 40
));
#
# user-cleanup event
#
event_actions('user-cleanup', qw(
nethserver-sssd-user-home-cleanup 10
));
#
# user-delete calls user-cleanup event
#
event_actions('user-delete', qw(
nethserver-sssd-data-cleanup 90
));