-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdisable_services.pp
67 lines (63 loc) · 2.3 KB
/
disable_services.pp
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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
class roles_profiles::profiles::disable_services {
case $facts['os']['name'] {
'Darwin': {
service {
['com.apple.apsd',
'com.apple.systemstats.daily',
'com.apple.systemstats.analysis',
'com.apple.metadata.mds',
'com.apple.metadata.mds.index',
'com.apple.metadata.mds.scan',
'com.apple.metadata.mds.spindump',]:
ensure => 'stopped',
enable => false,
}
exec {
'disable-indexing':
command => '/usr/bin/mdutil -a -i off',
refreshonly => true;
'remove-index':
command => '/usr/bin/mdutil -a -E',
refreshonly => true;
}
file { '/var/db/.spotlight-indexing-disabled':
content => 'indexing-disabled',
notify => Exec['disable-indexing', 'remove-index'],
}
include macos_mobileconfig_profiles::disable_diagnostic_submissions
include macos_mobileconfig_profiles::disable_gatekeeper
}
'Windows': {
include win_disable_services::disable_puppet
include win_disable_services::disable_windows_update
if $facts['custom_win_purpose'] != builder {
include win_disable_services::disable_wsearch
if ($facts['custom_win_location'] == 'azure') {
include win_scheduled_tasks::kill_local_clipboard
}
if $facts['custom_win_release_id'] == '2004' or '2009' {
## win11 ref with osdcloud
include win_disable_services::disable_windows_defender_schtask
}
}
if $facts['os']['release']['full'] == '10' {
include win_disable_services::disable_onedrive
}
if ($facts['custom_win_location'] == 'datacenter') {
if ($facts['custom_win_purpose'] == 'tester') {
include win_disable_services::disable_onedrive
}
}
# May be needed for non-hardaware
# Commented out because this will break the auto restore
# include win_disable_services::disable_vss
# include win_disable_services::disable_system_restore
}
default: {
fail("${facts['os']['name']} not supported")
}
}
}