-
Notifications
You must be signed in to change notification settings - Fork 2
/
infrastructure-formulas.spec
473 lines (361 loc) · 13 KB
/
infrastructure-formulas.spec
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
#
# spec file for package infrastructure-formulas
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define fdir %{_datadir}/salt-formulas
%define sdir %{fdir}/states
%define mdir %{fdir}/metadata
Name: infrastructure-formulas
Version: 2.7.2
Release: 0
Summary: Custom Salt states for the openSUSE/SUSE infrastructures
License: GPL-3.0-or-later
Group: System/Management
URL: https://github.com/openSUSE/salt-formulas
Source: _service
Requires: apache_httpd-formula
Requires: backupscript-formula
Requires: bootloader-formula
Requires: doofetch-formula
Requires: gitea-formula
Requires: grains-formula
Requires: infrastructure-formula
Requires: jenkins-formula
Requires: juniper_junos-formula
Requires: kexec-formula
Requires: libvirt-formula
Requires: lldpd-formula
Requires: lock-formula
Requires: lunmap-formula
Requires: mtail-formula
Requires: multipath-formula
Requires: network-formula
Requires: orchestra-formula
Requires: os_update-formula
Requires: rebootmgr-formula
Requires: redis-formula
Requires: redmine-formula
Requires: rsync-formula
Requires: security-formula
Requires: smartmontools-formula
Requires: status_mail-formula
Requires: suse_ha-formula
Requires: sysconfig-formula
Requires: tayga-formula
Requires: zypper-formula
BuildArch: noarch
%description
Custom Salt states used in the openSUSE and SUSE infrastructures.
%package common
Summary: Files and directories shared by formulas
License: GPL-3.0-or-later
%description common
Files and directories shared by openSUSE/SUSE infrastructure formuas.
%package -n apache_httpd-formula
Summary: Salt states for managing the Apache httpd
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n apache_httpd-formula
Salt states for installing and configuring the Apache HTTP server on SUSE distributions.
%package -n backupscript-formula
Summary: Salt states for managing SUSE backup scripts
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n backupscript-formula
Salt states for installing and configuring the SUSE backup scripts for MySQL and PostgreSQL.
%package -n bootloader-formula
Summary: Salt states for managing the bootloader
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n bootloader-formula
Salt states for managing the bootloader setup and GRUB configuration.
%package -n doofetch-formula
Summary: Salt states for managing doofetch
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n doofetch-formula
Salt states for installing and configuring doofetch.
%package -n gitea-formula
Summary: Salt states for managing Gitea
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n gitea-formula
Salt states for managing Gitea.
%package -n grains-formula
Summary: Salt state for managing grains
License: Apache-2.0
Requires: %{name}-common
%description -n grains-formula
Salt state for managing grains.
%package -n infrastructure-formula
Summary: Salt states specific to the openSUSE/SUSE infrastructures
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n infrastructure-formula
Custom Salt states specific to the openSUSE/SUSE infrastructures.
%package -n jenkins-formula
Summary: Salt states for managing Jenkins
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n jenkins-formula
Salt states for managing Jenkins Controller and Agent servers
%package -n juniper_junos-formula
Summary: Salt states for managing Junos
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n juniper_junos-formula
Salt states for managing Juniper Junos based network devices using pillars.
%package -n kexec-formula
Summary: Salt states for managing Kexec
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n kexec-formula
Salt states for managing Kexec using the kexec-load service
%package -n libvirt-formula
Summary: Salt states for managing libvirt
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n libvirt-formula
Salt states for managing libvirt servers.
%package -n lldpd-formula
Summary: Salt states for managing lldpd
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n lldpd-formula
Salt states for installing and configuring lldpd.
%package -n lock-formula
Summary: Salt state module for managing lockfiles
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n lock-formula
Salt state module allowing you to place a lock file prior to other states in order to prevent simultaneous executions.
%package -n lunmap-formula
Summary: Salt states for managing lunmap
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n lunmap-formula
Salt states for managing LUN mappings.
%package -n mtail-formula
Summary: Salt states for managing mtail
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n mtail-formula
Salt states for managing mtail.
%package -n multipath-formula
Summary: Salt states for managing multipath
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n multipath-formula
Salt states for installing multipath-tools and managing multipath/multipathd
%package -n network-formula
Summary: Salt states for managing the network
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n network-formula
Salt states for managing the network configuration using backends like Wicked.
%package -n orchestra-formula
Summary: Salt orchestration helper states
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n orchestra-formula
Salt helper states for the openSUSE/SUSE infrastructure orchestration states.
%package -n os_update-formula
Summary: Salt states for managing os-update
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n os_update-formula
Salt states for managing os-update.
%package -n rebootmgr-formula
Summary: Salt states for managing rebootmgr
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n rebootmgr-formula
Salt states for managing rebootmgr.
%package -n redis-formula
Summary: Salt states for managing Redis
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n redis-formula
Salt states for managing Redis.
%package -n redmine-formula
Summary: Salt states for managing Redmine
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n redmine-formula
Salt states for managing Redmine.
%package -n rsync-formula
Summary: Salt states for managing rsyncd
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n rsync-formula
Salt states for managing rsyncd.
%package -n security-formula
Summary: Salt states for managing permissions
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n security-formula
Salt states for configuring permissions and capabilities.
%package -n smartmontools-formula
Summary: Salt states for managing smartmontools
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n smartmontools-formula
Salt states for installing smartmontools and configuring smartd
%package -n status_mail-formula
Summary: Salt states for managing systemd-status-mail
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n status_mail-formula
Salt states for managing systemd-status-mail.
%package -n suse_ha-formula
Summary: Salt states for managing SLE HA clusters
License: GPL-3.0-or-later
Requires: %{name}-common
Requires: sysconfig-formula
%description -n suse_ha-formula
Salt states for managing SUSE Linux Enterprise HA clusters.
%package -n sysconfig-formula
Summary: Salt helpers for sysconfig
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n sysconfig-formula
Library formula containing helper code for managing fillup/sysconfig files.
%package -n tayga-formula
Summary: Salt states for managing TAYGA
License: GPL-3.0-or-later
Requires: %{name}-common
%description -n tayga-formula
Salt states for managing the TAYGA NAT64 daemon
%package -n zypper-formula
Summary: Salt states for managing zypper
License: Apache-2.0
Requires: %{name}-common
%description -n zypper-formula
Salt states for configuring packages, repositories, and zypper itself.
%prep
mv %{_sourcedir}/salt-formulas-%{version}/* .
%build
%install
install -dm0755 %{buildroot}%{mdir} %{buildroot}%{sdir} %{buildroot}%{sdir}/_modules %{buildroot}%{sdir}/_states %{buildroot}%{_bindir}
dst_execumodules="%{sdir}/_modules"
dst_statemodules="%{sdir}/_states"
dst_bin='%{_bindir}'
for formula in $(find -mindepth 1 -maxdepth 1 -type d -name '*-formula' -printf '%%P\n')
do
echo "$formula"
fname="${formula%%-*}"
src_metadata="$formula/metadata"
src_states="$formula/$fname"
if [ ! -d "$src_states" ]
then
src_states="$formula/${fname//_/-}"
fi
src_execumodules="$formula/_modules"
src_statemodules="$formula/_states"
src_bin="$formula/bin"
dst_metadata="%{mdir}/$fname"
dst_states="%{sdir}/$fname"
if [ -d "$src_metadata" ]
then
cp -rv "$src_metadata" "%{buildroot}$dst_metadata"
echo "$dst_metadata" > "$fname.files"
fi
if [ -d "$src_states" ]
then
cp -rv "$src_states" "%{buildroot}$dst_states"
echo "$dst_states" >> "$fname.files"
else
echo "Warning: $formula does not ship with any states"
fi
for mod in execu state bin
do
mode=0644
case "$mod" in
'execu' ) src="$src_execumodules"
dst="$dst_execumodules"
;;
'state' ) src="$src_statemodules"
dst="$dst_statemodules"
;;
'bin' )
src="$src_bin"
dst="$dst_bin"
mode=0755
;;
esac
if [ -d "$src" ]
then
find "$src" -type f \
-execdir install -vm "$mode" {} "%{buildroot}$dst" \; \
-execdir sh -cx 'echo "$1/$(basename $2)" >> "$3"' prog "$dst" {} "../../$fname.files" \;
fi
done
for license in 'COPYING' 'LICENCE' 'LICENSE'
do
if [ -f "$formula/$license" ]
then
echo "%%license $formula/$license" >> "$fname.files"
break
fi
done
done
%files
%files common
%license COPYING
%doc README.md
%dir %{fdir}
%dir %{mdir}
%dir %{sdir}
%dir %{sdir}/_{modules,states}
%files -n apache_httpd-formula -f apache_httpd.files
%files -n backupscript-formula -f backupscript.files
%files -n bootloader-formula -f bootloader.files
%files -n doofetch-formula -f doofetch.files
%files -n gitea-formula -f gitea.files
%files -n grains-formula -f grains.files
%files -n infrastructure-formula -f infrastructure.files
%files -n jenkins-formula -f jenkins.files
%files -n juniper_junos-formula -f juniper_junos.files
%files -n kexec-formula -f kexec.files
%files -n libvirt-formula -f libvirt.files
%files -n lldpd-formula -f lldpd.files
%files -n lock-formula -f lock.files
%files -n lunmap-formula -f lunmap.files
%files -n mtail-formula -f mtail.files
%files -n multipath-formula -f multipath.files
%files -n network-formula -f network.files
%files -n orchestra-formula -f orchestra.files
%files -n os_update-formula -f os_update.files
%files -n rebootmgr-formula -f rebootmgr.files
%files -n redis-formula -f redis.files
%files -n redmine-formula -f redmine.files
%files -n rsync-formula -f rsync.files
%files -n security-formula -f security.files
%files -n smartmontools-formula -f smartmontools.files
%files -n status_mail-formula -f status_mail.files
%files -n suse_ha-formula -f suse_ha.files
%files -n sysconfig-formula -f sysconfig.files
%files -n tayga-formula -f tayga.files
%files -n zypper-formula -f zypper.files
%changelog