Mercurial > repos > other > Puppet
annotate manifests/templates.pp @ 459:d7af40e44502
Use Apache for BDStrike cron to fix post-update warnings
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 02 Sep 2023 20:03:11 +0100 |
parents | d7ad78f128b1 |
children | ce488cfb225a |
rev | line source |
---|---|
32
6bbc86f6cee5
Tidy up ordering and dependencies (including making sure we have a necessary file for Fail2Ban to start)
IBBoard <dev@ibboard.co.uk>
parents:
25
diff
changeset
|
1 # Make sure packages come after their repos |
382
308b4149bee5
Add anchors to simplify dependencies
IBBoard <dev@ibboard.co.uk>
parents:
379
diff
changeset
|
2 File<| tag == 'repo-config' |> |
308b4149bee5
Add anchors to simplify dependencies
IBBoard <dev@ibboard.co.uk>
parents:
379
diff
changeset
|
3 -> anchor { 'Repo-config': } |
308b4149bee5
Add anchors to simplify dependencies
IBBoard <dev@ibboard.co.uk>
parents:
379
diff
changeset
|
4 -> YumRepo<| |> |
446
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
5 -> Apt::Source<| |> |
382
308b4149bee5
Add anchors to simplify dependencies
IBBoard <dev@ibboard.co.uk>
parents:
379
diff
changeset
|
6 -> anchor { 'Repos': } |
308b4149bee5
Add anchors to simplify dependencies
IBBoard <dev@ibboard.co.uk>
parents:
379
diff
changeset
|
7 -> Package<| |> |
32
6bbc86f6cee5
Tidy up ordering and dependencies (including making sure we have a necessary file for Fail2Ban to start)
IBBoard <dev@ibboard.co.uk>
parents:
25
diff
changeset
|
8 |
6bbc86f6cee5
Tidy up ordering and dependencies (including making sure we have a necessary file for Fail2Ban to start)
IBBoard <dev@ibboard.co.uk>
parents:
25
diff
changeset
|
9 # Make sure all files are in place before starting services |
298 | 10 # FIXME: Title matches are to fix a dependency cycle |
382
308b4149bee5
Add anchors to simplify dependencies
IBBoard <dev@ibboard.co.uk>
parents:
379
diff
changeset
|
11 File<| tag != 'post-service' and title != '/etc/sysconfig/ip6tables' and title != '/etc/sysconfig/iptables' |> |
308b4149bee5
Add anchors to simplify dependencies
IBBoard <dev@ibboard.co.uk>
parents:
379
diff
changeset
|
12 -> anchor { 'Pre-Service Files': } |
308b4149bee5
Add anchors to simplify dependencies
IBBoard <dev@ibboard.co.uk>
parents:
379
diff
changeset
|
13 -> Service<| |> |
246 | 14 |
15 # Set some shortcut variables | |
16 #$os = $operatingsystem | |
249
e9323ff8f451
Make EPEL work on multiple versions of CentOS
IBBoard <dev@ibboard.co.uk>
parents:
247
diff
changeset
|
17 $osver = $operatingsystemmajrelease |
246 | 18 $server = '' |
32
6bbc86f6cee5
Tidy up ordering and dependencies (including making sure we have a necessary file for Fail2Ban to start)
IBBoard <dev@ibboard.co.uk>
parents:
25
diff
changeset
|
19 |
6bbc86f6cee5
Tidy up ordering and dependencies (including making sure we have a necessary file for Fail2Ban to start)
IBBoard <dev@ibboard.co.uk>
parents:
25
diff
changeset
|
20 |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 class basenode { |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 include sudo |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 include defaultusers |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 include logwatch |
24
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
26 |
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
27 file { '/etc/puppet/hiera.yaml': |
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
28 ensure => present, |
264 | 29 content => " |
30 # Let the system set defaults | |
31 version: 5 | |
32 ", | |
24
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
33 } |
458 | 34 service { 'puppet': |
35 ensure => stopped, | |
36 enable => false, | |
37 } | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
38 if $operatingsystem == 'Ubuntu' { |
447
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
39 package { 'locales': |
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
40 ensure => present |
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
41 } -> |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
42 file { '/etc/locale.gen': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
43 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
44 content => "en_GB.UTF-8 UTF-8", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
45 notify => Exec['Regen locales'] |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
46 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
47 exec { 'Regen locales': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
48 command => 'locale-gen', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
49 refreshonly => true |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
50 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
51 # Don't waste space with Snap and do everything properly with system packages |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
52 [ 'lxd', 'core18', 'core20', 'snapd'].each |$snap| { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
53 exec { "remove $snap snap package": |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
54 command => "snap remove $snap", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
55 onlyif => "which snap && snap list $snap", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
56 tag => 'snap', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
57 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
58 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
59 Exec<| tag == 'snap' |> -> |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
60 package { 'snapd': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
61 ensure => purged, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
62 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
63 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
64 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
65 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
66 class basevpsnode ( |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
67 $primary_ip, |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
68 $gateway_ip = undef, |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
69 $proxy_4to6_ip_prefix = undef, |
279 | 70 $proxy_upstream = undef, |
326 | 71 $nat64_ranges = [], |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
72 $mailserver, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
73 $imapserver, |
326 | 74 $mailrelays = [], |
35
1bb941522ebf
Handle differences in firewalling between ASO (using APF) and most other hosts (using iptables)
IBBoard <dev@ibboard.co.uk>
parents:
32
diff
changeset
|
75 $firewall_cmd = 'iptables', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
76 ) { |
44
546dfa011f58
Remove "puppet" host name because we don't need it
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
77 |
40
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
78 if $firewall_cmd == 'iptables' { |
279 | 79 class { 'vpsfirewall': |
80 fw_protocol => $primary_ip =~ Stdlib::IP::Address::V6 ? { true => 'IPv6', default => 'IPv4'}, | |
81 } | |
40
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
82 } |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
83 |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
84 #VPS is a self-mastered Puppet machine, so bodge a Hosts file |
302 | 85 if $primary_ip =~ Stdlib::IP::Address::V6 { |
86 $lo_ip = '::1' | |
87 } else { | |
88 $lo_ip = '127.0.0.1' | |
89 } | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
90 file { '/etc/hosts': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
91 ensure => present, |
302 | 92 content => "${lo_ip} localhost\n${primary_ip} ${fqdn}", |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
93 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
94 |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
95 if $proxy_4to6_ip_prefix != undef { |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
96 if $operatingsystem == 'Ubuntu' { |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
97 # Ubuntu can't parse the existing file, so we need to brute-force it with a template |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
98 file { "/etc/network/interfaces.d/eth0": |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
99 content => epp('privat/eth0.epp', |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
100 { |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
101 default_address => $primary_ip, |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
102 gateway_address => $gateway_ip, |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
103 prefix_address => $proxy_4to6_ip_prefix, |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
104 } |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
105 ), |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
106 } |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
107 |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
108 # # …:1 to …:9 for websites, …:10 for mail |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
109 # Integer[1, 10].each |$octet| { |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
110 # augeas { "IPv6 secondary address $octet": |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
111 # context => "/files/etc/network/interfaces.d/eth0", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
112 # changes => [ |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
113 # "set auto[child::1 = 'eth0:$octet']/1 eth0:$octet", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
114 # "set no-auto-down[child::1 = 'eth0:$octet']/1 eth0:$octet", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
115 # "set iface[. = 'eth0:$octet'] eth0:$octet", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
116 # "set iface[. = 'eth0:$octet']/family inet6", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
117 # "set iface[. = 'eth0:$octet']/method static", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
118 # "set iface[. = 'eth0:$octet']/address $proxy_4to6_ip_prefix:$octet", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
119 # "set iface[. = 'eth0:$octet']/netmask 64", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
120 # |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
121 # ], |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
122 # } |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
123 # } |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
124 } |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
125 else { |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
126 # …:1 to …:9 for websites, …:10 for mail |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
127 $ipv6_addresses = Integer[1, 10].map |$octet| { "$proxy_4to6_ip_prefix:$octet" } |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
128 $ipv6_secondaries = join($ipv6_addresses, " ") |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
129 |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
130 augeas {'IPv6 secondary addresses': |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
131 context => "/files/etc/sysconfig/network-scripts/ifcfg-eth0", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
132 changes => "set IPV6ADDR_SECONDARIES '\"$ipv6_secondaries\"'", |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
133 } |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
134 } |
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
135 } |
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
136 |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
137 require repos |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
138 include basenode |
246 | 139 include privat |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
140 include dnsresolver |
396
e93588ec1ce3
Use "param" variables for settings instead of conditions
IBBoard <dev@ibboard.co.uk>
parents:
393
diff
changeset
|
141 include ::privat::params |
e93588ec1ce3
Use "param" variables for settings instead of conditions
IBBoard <dev@ibboard.co.uk>
parents:
393
diff
changeset
|
142 class { '::ssh': |
e93588ec1ce3
Use "param" variables for settings instead of conditions
IBBoard <dev@ibboard.co.uk>
parents:
393
diff
changeset
|
143 sshd_config_port => $::privat::params::ssh_port[$::fqdn] |
e93588ec1ce3
Use "param" variables for settings instead of conditions
IBBoard <dev@ibboard.co.uk>
parents:
393
diff
changeset
|
144 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
145 include vcs::server |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
146 include vcs::client |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
147 class { 'webserver': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
148 primary_ip => $primary_ip, |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
149 proxy_4to6_ip_prefix => $proxy_4to6_ip_prefix, |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
150 proxy_4to6_mask => 124, |
279 | 151 proxy_upstream => $proxy_upstream, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
152 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
153 include cronjobs |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
154 include logrotate |
35
1bb941522ebf
Handle differences in firewalling between ASO (using APF) and most other hosts (using iptables)
IBBoard <dev@ibboard.co.uk>
parents:
32
diff
changeset
|
155 class { 'fail2ban': |
1bb941522ebf
Handle differences in firewalling between ASO (using APF) and most other hosts (using iptables)
IBBoard <dev@ibboard.co.uk>
parents:
32
diff
changeset
|
156 firewall_cmd => $firewall_cmd, |
1bb941522ebf
Handle differences in firewalling between ASO (using APF) and most other hosts (using iptables)
IBBoard <dev@ibboard.co.uk>
parents:
32
diff
changeset
|
157 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
158 include tools |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
159 class { 'email': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
160 mailserver => $mailserver, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
161 imapserver => $imapserver, |
311
51d3748f8112
Configure Dovecot (IMAP) for PROXY protocol use
IBBoard <dev@ibboard.co.uk>
parents:
310
diff
changeset
|
162 mailserver_ip => $primary_ip, |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
163 proxy_ip => $proxy_4to6_ip_prefix != undef ? { true => "${proxy_4to6_ip_prefix}:10", default => undef }, |
311
51d3748f8112
Configure Dovecot (IMAP) for PROXY protocol use
IBBoard <dev@ibboard.co.uk>
parents:
310
diff
changeset
|
164 proxy_upstream => $proxy_upstream, |
326 | 165 nat64_ranges => $nat64_ranges, |
166 mailrelays => $mailrelays, | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
167 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
168 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
169 |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
170 ## Classes to allow facet behaviour using preconfigured setups of classes |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
171 |
279 | 172 class vpsfirewall ($fw_protocol) { |
40
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
173 resources { "firewall": |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
174 purge => false, |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
175 } |
279 | 176 class { "my_fw": |
177 ip_version => $fw_protocol, | |
178 } | |
179 # Control what does and doesn't get pruned in the main filter chain | |
180 firewallchain { "INPUT:filter:$fw_protocol": | |
181 purge => true, | |
40
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
182 ignore => [ |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
183 '-j f2b-[^ ]+$', |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
184 '^(:|-A )f2b-', |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
185 '--comment "Great Firewall of China"', |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
186 '--comment "Do not purge', |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
187 ], |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
188 } |
279 | 189 if ($fw_protocol != "IPv6") { |
190 firewall { '010 Whitelist Googlebot': | |
191 source => '66.249.64.0/19', | |
192 dport => [80,443], | |
193 proto => tcp, | |
194 action => accept, | |
195 } | |
196 # Block a spammer hitting our contact forms (also on StopForumSpam list A LOT) | |
197 firewall { '099 Blacklist spammers 1': | |
198 source => '107.181.78.172', | |
199 dport => [80, 443], | |
200 proto => tcp, | |
201 action => 'reject', | |
202 } | |
203 firewall { '099 Blacklist IODC bot': | |
204 # IODC bot makes too many bad requests, and contact form is broken | |
205 # They don't publish a robots.txt name, so firewall it! | |
206 source => '86.153.145.149', | |
207 dport => [ 80, 443 ], | |
208 proto => tcp, | |
209 action => 'reject', | |
210 } | |
211 firewall { '099 Blacklist Baidu Brazil': | |
212 #Baidu got a Brazilian netblock and are hitting us hard | |
213 #Baidu doesn't honour "crawl-delay" in robots.txt | |
214 #Baidu gets firewalled | |
215 source => '131.161.8.0/22', | |
216 dport => [ 80, 443 ], | |
217 proto => tcp, | |
218 action => 'reject', | |
219 } | |
139
abaf384dc939
Block another annoying IP with a firewall rule
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
220 } |
279 | 221 firewallchain { "GREATFIREWALLOFCHINA:filter:$fw_protocol": |
40
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
222 ensure => present, |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
223 } |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
224 firewall { '050 Check our Great Firewall Against China': |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
225 chain => 'INPUT', |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
226 jump => 'GREATFIREWALLOFCHINA', |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
227 } |
279 | 228 firewallchain { "Fail2Ban:filter:$fw_protocol": |
64
3bb824dabaae
Make sure Fail2Ban rules are in right order (using separate chain) and whitelist Googlebot (which keeps hitting Script Kiddy targets for unknown reasons)
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
229 ensure => present, |
3bb824dabaae
Make sure Fail2Ban rules are in right order (using separate chain) and whitelist Googlebot (which keeps hitting Script Kiddy targets for unknown reasons)
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
230 } |
3bb824dabaae
Make sure Fail2Ban rules are in right order (using separate chain) and whitelist Googlebot (which keeps hitting Script Kiddy targets for unknown reasons)
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
231 firewall { '060 Check Fail2Ban': |
3bb824dabaae
Make sure Fail2Ban rules are in right order (using separate chain) and whitelist Googlebot (which keeps hitting Script Kiddy targets for unknown reasons)
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
232 chain => 'INPUT', |
3bb824dabaae
Make sure Fail2Ban rules are in right order (using separate chain) and whitelist Googlebot (which keeps hitting Script Kiddy targets for unknown reasons)
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
233 jump => 'Fail2Ban', |
3bb824dabaae
Make sure Fail2Ban rules are in right order (using separate chain) and whitelist Googlebot (which keeps hitting Script Kiddy targets for unknown reasons)
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
234 } |
40
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
235 } |
222904296578
Add firewall handling when we run without APF
IBBoard <dev@ibboard.co.uk>
parents:
38
diff
changeset
|
236 |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
237 class dnsresolver { |
290
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
238 package { 'unbound': |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
239 ensure => present, |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
240 } |
290
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
241 package { 'named': |
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
242 ensure => absent, |
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
243 } |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
244 |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
245 service { 'named': |
290
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
246 ensure => stopped, |
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
247 enable => false, |
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
248 } |
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
249 service { 'unbound': |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
250 ensure => running, |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
251 enable => true, |
194
a08de3153548
Add a named.conf file to control cache/memory size
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
252 } |
a08de3153548
Add a named.conf file to control cache/memory size
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
253 |
a08de3153548
Add a named.conf file to control cache/memory size
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
254 file { '/etc/named.conf': |
290
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
255 ensure => absent, |
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
256 } |
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
257 file { '/etc/unbound/unbound.conf': |
194
a08de3153548
Add a named.conf file to control cache/memory size
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
258 ensure => present, |
247 | 259 source => [ |
290
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
260 "puppet:///common/unbound.conf-${::hostname}", |
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
261 "puppet:///common/unbound.conf", |
247 | 262 ], |
290
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
263 require => Package['unbound'], |
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
264 notify => Service['unbound'], |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
265 } |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
266 file { ['/etc/NetworkManager', '/etc/NetworkManager/conf.d']: |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
267 ensure => directory |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
268 } |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
269 file { '/etc/NetworkManager/conf.d/local-dns-resolver.conf': |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
270 ensure => present, |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
271 content => "[main] |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
272 dns=none", |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
273 } |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
274 |
101
a48b6011a084
Stop Bind trying IPv6, as we only have a link-local IP
IBBoard <dev@ibboard.co.uk>
parents:
100
diff
changeset
|
275 file { '/etc/sysconfig/named': |
290
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
276 ensure => absent, |
101
a48b6011a084
Stop Bind trying IPv6, as we only have a link-local IP
IBBoard <dev@ibboard.co.uk>
parents:
100
diff
changeset
|
277 } |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
278 file { '/etc/resolv.conf': |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
279 ensure => file, |
301
1bfc290270cc
Fix sa-update by using IPv6 for local DNS cache
IBBoard <dev@ibboard.co.uk>
parents:
298
diff
changeset
|
280 # "ipaddress" key only exists for machines with IPv4 addresses |
1bfc290270cc
Fix sa-update by using IPv6 for local DNS cache
IBBoard <dev@ibboard.co.uk>
parents:
298
diff
changeset
|
281 content => has_key($facts, 'ipaddress') ? { true => "nameserver 127.0.0.1", default => "nameserver ::1" }, |
290
1182a180085d
Swap from Bind to Named for light-weight DNS
IBBoard <dev@ibboard.co.uk>
parents:
268
diff
changeset
|
282 require => Service['unbound'], |
246 | 283 tag => 'post-service', |
100
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
284 } |
fd3446c3b7b9
Set up a recursive localhost-only Bind server (assuming RH's safe and sane default configs)
IBBoard <dev@ibboard.co.uk>
parents:
99
diff
changeset
|
285 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
286 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
287 class repos { |
439
e4de05e3a2f8
Ensure Python params are included
IBBoard <dev@ibboard.co.uk>
parents:
435
diff
changeset
|
288 include ::python::params |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
289 if $operatingsystem == 'CentOS' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
290 yumrepo { 'epel': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
291 mirrorlist => 'https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
292 descr => "Extra Packages for Enterprise Linux", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
293 enabled => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
294 failovermethod => absent, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
295 gpgcheck => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
296 gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$osver", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
297 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
298 file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$osver": |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
299 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
300 source => "puppet:///common/RPM-GPG-KEY-EPEL-$osver", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
301 tag => 'repo-config', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
302 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
303 yumrepo { 'ibboard': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
304 baseurl => 'https://download.opensuse.org/repositories/home:/IBBoard:/server/CentOS_$releasever/', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
305 descr => 'Extra packages from IBBoard', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
306 enabled => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
307 gpgcheck => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
308 gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ibboard', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
309 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
310 file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-ibboard': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
311 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
312 source => 'puppet:///common/RPM-GPG-KEY-ibboard', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
313 tag => 'repo-config', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
314 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
315 yumrepo { 'webtatic': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
316 ensure => absent, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
317 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
318 file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
319 ensure => absent, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
320 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
321 file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-el7': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
322 ensure => absent, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
323 } |
409
621e78abf82c
Fix `requires devel` problem with CentOS
IBBoard <dev@ibboard.co.uk>
parents:
408
diff
changeset
|
324 # Python requires the `devel` package on CentOS, but by default the module tries to uninstall it |
621e78abf82c
Fix `requires devel` problem with CentOS
IBBoard <dev@ibboard.co.uk>
parents:
408
diff
changeset
|
325 $dev = 'present' |
621e78abf82c
Fix `requires devel` problem with CentOS
IBBoard <dev@ibboard.co.uk>
parents:
408
diff
changeset
|
326 } |
621e78abf82c
Fix `requires devel` problem with CentOS
IBBoard <dev@ibboard.co.uk>
parents:
408
diff
changeset
|
327 else { |
621e78abf82c
Fix `requires devel` problem with CentOS
IBBoard <dev@ibboard.co.uk>
parents:
408
diff
changeset
|
328 # Other distros can take the default devel status |
621e78abf82c
Fix `requires devel` problem with CentOS
IBBoard <dev@ibboard.co.uk>
parents:
408
diff
changeset
|
329 $dev = $::python::params::dev |
447
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
330 # CentOS-like distros have PKI by default. Others need it creating. |
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
331 file { '/etc/pki/': |
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
332 ensure => directory, |
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
333 } |
446
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
334 |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
335 apt::source { |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
336 'ibboard': |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
337 location => 'http://download.opensuse.org/repositories/home:/IBBoard:/server/xUbuntu_22.04/', |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
338 release => '/', |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
339 repos => '', |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
340 key => { |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
341 id => 'EDC682701D792970AD8645E7A7A55B845DCFCBE2', |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
342 source => "https://download.opensuse.org/repositories/home:IBBoard:server/xUbuntu_22.04/Release.key" |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
343 } |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
344 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
345 } |
148 | 346 |
272
c42fb28cff86
Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
271
diff
changeset
|
347 if $operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '8') >= 0 { |
383
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
348 # The following may possibly work to ensure a CentOS Streams install. |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
349 # Or it might fail for inexplicable reasons. |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
350 # FIXME: Should be "centos-release-stream" to migrate (provides repos), but then that gets replaced by centos-stream-release, |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
351 # which Puppet doesn't recognise as the same and so keeps trying to re-install. May need an "unless" or maybe "allow_virtual" |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
352 package { 'centos-stream-release': |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
353 ensure => installed, |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
354 notify => Exec['migrate to streams']; |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
355 } |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
356 exec { 'migrate to streams': |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
357 command => '/usr/bin/dnf swap centos-linux-repos centos-stream-repos; /usr/bin/dnf distro-sync -y', |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
358 refreshonly => true |
f9a6f6ff8256
Attempt to migrate CentOS8 to Streams automatically
IBBoard <dev@ibboard.co.uk>
parents:
382
diff
changeset
|
359 } |
148 | 360 } |
272
c42fb28cff86
Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
271
diff
changeset
|
361 |
c42fb28cff86
Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
271
diff
changeset
|
362 class { 'python': |
c42fb28cff86
Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
271
diff
changeset
|
363 ensure => 'present', |
401
f0ee7a16125d
Switch to Python 3 on all platforms
IBBoard <dev@ibboard.co.uk>
parents:
399
diff
changeset
|
364 version => 'python3', |
272
c42fb28cff86
Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
271
diff
changeset
|
365 pip => 'present', |
c42fb28cff86
Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
271
diff
changeset
|
366 use_epel => false, |
409
621e78abf82c
Fix `requires devel` problem with CentOS
IBBoard <dev@ibboard.co.uk>
parents:
408
diff
changeset
|
367 dev => $dev, |
272
c42fb28cff86
Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
271
diff
changeset
|
368 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
369 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
370 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
371 class tools { |
446
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
372 $packages = [ 'sqlite', 'bash-completion', 'nano', 'zip', 'bzip2', 'mlocate', 'patch', 'tmux', 'wget', 'rsync' ] |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
373 package { $packages: |
131
0dd899a10ee1
Change all "latest" packages to "installed"
IBBoard <dev@ibboard.co.uk>
parents:
129
diff
changeset
|
374 ensure => installed; |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
375 } |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
376 if $osfamily == 'RedHat' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
377 package { 'yum-utils': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
378 ensure => installed |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
379 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
380 } |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
381 elsif $osfamily == 'Debian' { |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
382 package { 'dnsutils': |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
383 ensure => installed |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
384 } |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
385 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
386 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
387 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
388 class logrotate { |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
389 package { 'logrotate': |
131
0dd899a10ee1
Change all "latest" packages to "installed"
IBBoard <dev@ibboard.co.uk>
parents:
129
diff
changeset
|
390 ensure => installed; |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
391 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
392 file { '/etc/logrotate.d/httpd': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
393 ensure => present, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
394 source => 'puppet:///common/logrotate-httpd', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
395 require => Package['logrotate'], |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
396 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
397 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
398 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
399 class logwatch { |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
400 package { 'logwatch': |
131
0dd899a10ee1
Change all "latest" packages to "installed"
IBBoard <dev@ibboard.co.uk>
parents:
129
diff
changeset
|
401 ensure => installed; |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
402 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
403 File { |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
404 ensure => present, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
405 require => Package['logwatch'], |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
406 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
407 file { '/etc/cron.daily/0logwatch': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
408 source => 'puppet:///common/0logwatch'; |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
409 } |
332 | 410 $logwatch_dirs = [ |
411 '/etc/logwatch/', | |
412 '/etc/logwatch/conf/', | |
413 '/etc/logwatch/conf/logfiles/', | |
414 '/etc/logwatch/conf/services/', | |
345
bad68f1b6467
Add updated Dovecot script to Logwatch
IBBoard <dev@ibboard.co.uk>
parents:
342
diff
changeset
|
415 '/etc/logwatch/scripts/', |
bad68f1b6467
Add updated Dovecot script to Logwatch
IBBoard <dev@ibboard.co.uk>
parents:
342
diff
changeset
|
416 '/etc/logwatch/scripts/services/', |
332 | 417 ] |
418 file { $logwatch_dirs: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
419 ensure => directory, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
420 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
421 file { '/etc/logwatch/conf/logwatch.conf': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
422 content => 'Detail = Med', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
423 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
424 file { '/etc/logwatch/conf/logfiles/http.conf': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
425 content => 'LogFile = apache/access_*.log', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
426 } |
332 | 427 file { '/etc/logwatch/conf/logfiles/http-error.conf': |
428 source => 'puppet:///common/logwatch/logfiles_http-error.conf', | |
126
8316d4e55e92
Fix Apache 2.4 Logwatch support
IBBoard <dev@ibboard.co.uk>
parents:
125
diff
changeset
|
429 } |
332 | 430 file { '/etc/logwatch/conf/logfiles/mysql.conf': |
431 source => 'puppet:///common/logwatch/logfiles_mysql.conf', | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
432 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
433 file { '/etc/logwatch/conf/logfiles/php.conf': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
434 source => 'puppet:///common/logwatch/logfiles_php.conf', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
435 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
436 file { '/etc/logwatch/conf/services/php.conf': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
437 source => 'puppet:///common/logwatch/services_php.conf', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
438 } |
379
63adae1a374a
Fix and expand PHP logwatch config
IBBoard <dev@ibboard.co.uk>
parents:
378
diff
changeset
|
439 file { '/etc/logwatch/conf/services/contact-form.conf': |
63adae1a374a
Fix and expand PHP logwatch config
IBBoard <dev@ibboard.co.uk>
parents:
378
diff
changeset
|
440 source => 'puppet:///common/logwatch/services_contact-form.conf', |
63adae1a374a
Fix and expand PHP logwatch config
IBBoard <dev@ibboard.co.uk>
parents:
378
diff
changeset
|
441 } |
345
bad68f1b6467
Add updated Dovecot script to Logwatch
IBBoard <dev@ibboard.co.uk>
parents:
342
diff
changeset
|
442 file { '/etc/logwatch/scripts/services/dovecot': |
bad68f1b6467
Add updated Dovecot script to Logwatch
IBBoard <dev@ibboard.co.uk>
parents:
342
diff
changeset
|
443 source => 'puppet:///common/logwatch/dovecot', |
bad68f1b6467
Add updated Dovecot script to Logwatch
IBBoard <dev@ibboard.co.uk>
parents:
342
diff
changeset
|
444 } |
346
61be075c5a68
Ignore X-Comment "SPF whitelisted" messages in Logwatch
IBBoard <dev@ibboard.co.uk>
parents:
345
diff
changeset
|
445 file { '/etc/logwatch/scripts/services/postfix': |
61be075c5a68
Ignore X-Comment "SPF whitelisted" messages in Logwatch
IBBoard <dev@ibboard.co.uk>
parents:
345
diff
changeset
|
446 source => 'puppet:///common/logwatch/postfix', |
61be075c5a68
Ignore X-Comment "SPF whitelisted" messages in Logwatch
IBBoard <dev@ibboard.co.uk>
parents:
345
diff
changeset
|
447 } |
347
73d7b3ec6263
Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
346
diff
changeset
|
448 file { '/etc/logwatch/scripts/services/systemd': |
73d7b3ec6263
Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
346
diff
changeset
|
449 source => 'puppet:///common/logwatch/systemd', |
73d7b3ec6263
Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
346
diff
changeset
|
450 } |
379
63adae1a374a
Fix and expand PHP logwatch config
IBBoard <dev@ibboard.co.uk>
parents:
378
diff
changeset
|
451 file { '/etc/logwatch/scripts/services/php': |
63adae1a374a
Fix and expand PHP logwatch config
IBBoard <dev@ibboard.co.uk>
parents:
378
diff
changeset
|
452 source => 'puppet:///common/logwatch/php', |
63adae1a374a
Fix and expand PHP logwatch config
IBBoard <dev@ibboard.co.uk>
parents:
378
diff
changeset
|
453 } |
63adae1a374a
Fix and expand PHP logwatch config
IBBoard <dev@ibboard.co.uk>
parents:
378
diff
changeset
|
454 file { '/etc/logwatch/scripts/services/contact-form': |
63adae1a374a
Fix and expand PHP logwatch config
IBBoard <dev@ibboard.co.uk>
parents:
378
diff
changeset
|
455 source => 'puppet:///common/logwatch/contact-form', |
63adae1a374a
Fix and expand PHP logwatch config
IBBoard <dev@ibboard.co.uk>
parents:
378
diff
changeset
|
456 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
457 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
458 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
459 #Our web server with our configs, not just a stock one |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
460 class webserver ( |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
461 $primary_ip, |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
462 $proxy_4to6_ip_prefix = undef, |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
463 $proxy_4to6_mask = undef, |
279 | 464 $proxy_upstream = undef, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
465 ) { |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
466 |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
467 #Setup base website parameters |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
468 class { 'website': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
469 base_dir => '/srv/sites', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
470 primary_ip => $primary_ip, |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
471 proxy_4to6_ip_prefix => $proxy_4to6_ip_prefix, |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
472 proxy_4to6_mask => $proxy_4to6_mask, |
279 | 473 proxy_upstream => $proxy_upstream, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
474 default_owner => $defaultusers::default_user, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
475 default_group => $defaultusers::default_user, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
476 default_tld => 'co.uk', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
477 default_extra_tlds => [ 'com' ], |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
478 } |
110 | 479 |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
480 if $operatingsystem == 'CentOS' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
481 $php_suffix = '' |
454 | 482 $ini_prefix_20 = '20-' |
483 $ini_prefix_30 = '30-' | |
484 $ini_prefix_40 = '40-' | |
419 | 485 $variant_prefix = 'php-' |
416
b185498177ef
Backed out changeset 6421c6f77eb8 - Add SOAP
IBBoard <dev@ibboard.co.uk>
parents:
415
diff
changeset
|
486 $extra_prefix = 'pecl-' |
422 | 487 $extra_extras = { |
488 'posix' => { | |
489 ini_prefix => '20-', | |
446
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
490 }, |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
491 # Sodium has been bundled since 7.2, but CentOS packages it separately |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
492 'sodium' => { |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
493 ini_prefix => '20-', |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
494 }, |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
495 # JSON is integrated into PHP 8+ and so it's only a plugin in CentOS |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
496 'json' => { |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
497 ini_prefix => '20-', |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
498 }, |
422 | 499 } |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
500 if versioncmp($operatingsystemrelease, '8') >= 0 { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
501 yumrepo { 'remirepo-safe': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
502 mirrorlist => 'http://cdn.remirepo.net/enterprise/$releasever/safe/$basearch/mirror', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
503 descr => "Extra CentOS packages from Remi", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
504 enabled => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
505 failovermethod => absent, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
506 gpgcheck => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
507 gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
508 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
509 yumrepo { 'remirepo-php': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
510 mirrorlist => 'http://cdn.remirepo.net/enterprise/8/modular/$basearch/mirror', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
511 descr => 'Remi\'s Modular repository for Enterprise Linux 8 - $basearch', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
512 enabled => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
513 failovermethod => absent, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
514 gpgcheck => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
515 gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
516 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
517 file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-remi': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
518 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
519 source => 'puppet:///common/RPM-GPG-KEY-remi.el8', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
520 tag => 'repo-config', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
521 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
522 } else { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
523 yumrepo { 'remirepo-safe': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
524 mirrorlist => 'http://cdn.remirepo.net/enterprise/$releasever/safe/mirror', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
525 descr => "Extra CentOS packages from Remi", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
526 enabled => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
527 failovermethod => absent, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
528 gpgcheck => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
529 gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
530 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
531 yumrepo { 'remirepo-php': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
532 mirrorlist => 'http://cdn.remirepo.net/enterprise/$releasever/php74/mirror', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
533 descr => "PHP7.4 for CentOS from Remi", |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
534 enabled => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
535 failovermethod => absent, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
536 gpgcheck => 1, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
537 gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
538 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
539 file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-remi': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
540 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
541 source => 'puppet:///common/RPM-GPG-KEY-remi', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
542 tag => 'repo-config', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
543 } |
320 | 544 } |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
545 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
546 elsif $operatingsystem == 'Ubuntu' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
547 $php_suffix = '' |
454 | 548 $ini_prefix_20 = '' |
549 $ini_prefix_30 = '' | |
550 $ini_prefix_40 = '' | |
416
b185498177ef
Backed out changeset 6421c6f77eb8 - Add SOAP
IBBoard <dev@ibboard.co.uk>
parents:
415
diff
changeset
|
551 $variant_prefix = 'php-' |
b185498177ef
Backed out changeset 6421c6f77eb8 - Add SOAP
IBBoard <dev@ibboard.co.uk>
parents:
415
diff
changeset
|
552 $extra_prefix = '' |
446
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
553 # Work around constant re-install by enabling virtual packages |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
554 # https://github.com/voxpupuli/puppet-php/issues/387 |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
555 Package { |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
556 allow_virtual => true |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
557 } |
454 | 558 $extra_extras = { |
559 'xdebug' => { | |
560 # Occasional profiling retained in case I want to dig into | |
561 # Wordpress page load inefficiencies any more | |
562 ensure => absent, | |
563 # settings => { | |
564 # "xdebug.mode" => "profile", | |
565 # "xdebug.start_with_request" => "trigger", | |
566 # } | |
567 } | |
568 } | |
238 | 569 } |
110 | 570 |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
571 #Configure the PHP version to use |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
572 class { 'website::php': |
350
85d2c0079af9
Make opcache core and add APCu for object caching
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
573 suffix => $php_suffix, |
335
aa9f570d6a9c
Switch to PHP 7.4 now that NextCloud has reached v18
IBBoard <dev@ibboard.co.uk>
parents:
334
diff
changeset
|
574 module => ($operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '8') >= 0) ? { true => 'remi-7.4', default => undef }, |
416
b185498177ef
Backed out changeset 6421c6f77eb8 - Add SOAP
IBBoard <dev@ibboard.co.uk>
parents:
415
diff
changeset
|
575 extras => { |
422 | 576 'bcmath' => { |
454 | 577 ini_prefix => $ini_prefix_20, |
422 | 578 }, |
579 'curl' => { | |
454 | 580 ini_prefix => $ini_prefix_20, |
422 | 581 }, |
582 'dom' => { | |
454 | 583 ini_prefix => $ini_prefix_20, |
422 | 584 }, |
585 'enchant' => { | |
454 | 586 ini_prefix => $ini_prefix_20, |
422 | 587 }, |
588 'exif' => { | |
454 | 589 ini_prefix => $ini_prefix_20, |
416
b185498177ef
Backed out changeset 6421c6f77eb8 - Add SOAP
IBBoard <dev@ibboard.co.uk>
parents:
415
diff
changeset
|
590 }, |
422 | 591 'fileinfo' => { |
454 | 592 ini_prefix => $ini_prefix_20, |
422 | 593 }, |
594 'gmp' => { | |
454 | 595 ini_prefix => $ini_prefix_20, |
422 | 596 }, |
597 'intl' => { | |
454 | 598 ini_prefix => $ini_prefix_20, |
422 | 599 }, |
600 'mysqlnd' => { | |
454 | 601 ini_prefix => $ini_prefix_20, |
422 | 602 }, |
603 'pdo' => { | |
454 | 604 ini_prefix => $ini_prefix_20, |
419 | 605 }, |
422 | 606 'simplexml' => { |
454 | 607 ini_prefix => $ini_prefix_20, |
422 | 608 }, |
609 'soap' => { | |
454 | 610 ini_prefix => $ini_prefix_20, |
422 | 611 }, |
612 'xmlwriter' => { | |
454 | 613 ini_prefix => $ini_prefix_20, |
422 | 614 }, |
615 'mysqli' => { | |
454 | 616 ini_prefix => $ini_prefix_30, |
416
b185498177ef
Backed out changeset 6421c6f77eb8 - Add SOAP
IBBoard <dev@ibboard.co.uk>
parents:
415
diff
changeset
|
617 }, |
422 | 618 'pdo_mysql' => { |
454 | 619 ini_prefix => $ini_prefix_30, |
446
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
620 # Provided by the php-mysql package in CentOS and declared with "Provides" |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
621 # And Ubuntu is the same but without the "Provides" |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
622 provider => "none", |
422 | 623 }, |
624 'xmlreader' => { | |
454 | 625 ini_prefix => $ini_prefix_30, |
422 | 626 }, |
627 'zip' => { | |
454 | 628 ini_prefix => $ini_prefix_30, |
422 | 629 package_prefix => "${variant_prefix}${extra_prefix}" |
630 }, | |
631 'apcu' => { | |
454 | 632 ini_prefix => $ini_prefix_40, |
422 | 633 package_prefix => "${variant_prefix}${extra_prefix}" |
634 }, | |
635 'imagick' => { | |
454 | 636 ini_prefix => $ini_prefix_40, |
422 | 637 package_prefix => "${variant_prefix}${extra_prefix}" |
638 }, | |
416
b185498177ef
Backed out changeset 6421c6f77eb8 - Add SOAP
IBBoard <dev@ibboard.co.uk>
parents:
415
diff
changeset
|
639 } + $extra_extras, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
640 } |
24
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
641 |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
642 #Setup MySQL, using (private) templates to make sure that we set non-std passwords and a default user |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
643 if $operatingsystem == 'CentOS' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
644 if versioncmp($operatingsystemrelease, '7') >= 0 { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
645 $mysqlpackage = 'mariadb' |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
646 $mysqlsuffix = '' |
24
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
647 |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
648 # Required for SELinux rule setting/status checks |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
649 if versioncmp($operatingsystemrelease, '8') >= 0 { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
650 $semanage_package_name = 'policycoreutils-python-utils' |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
651 } else { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
652 $semanage_package_name = 'policycoreutils-python' |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
653 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
654 |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
655 package { 'policycoreutils-python': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
656 name => $semanage_package_name, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
657 ensure => present, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
658 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
659 |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
660 $extra_packages = [ |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
661 'perl-Sys-Syslog', #Required for Perl SPF checking |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
662 ] |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
663 |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
664 package { $extra_packages: |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
665 ensure => installed |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
666 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
667 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
668 else { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
669 $mysqlpackage = 'mysql' |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
670 $mysqlsuffix = '55w' |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
671 } |
393
a948419a23b1
Fix MySQL package names on Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
390
diff
changeset
|
672 $phpmysqlsuffix = 'nd' |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
673 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
674 elsif $operatingsystem == 'Ubuntu' { |
24
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
675 $mysqlpackage = 'mariadb' |
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
676 $mysqlsuffix = '' |
393
a948419a23b1
Fix MySQL package names on Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
390
diff
changeset
|
677 $phpmysqlsuffix = '' |
24
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
678 } |
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
679 else { |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
680 fail("No MySQL support for ${operatingsystem}") |
24
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
681 } |
402 | 682 include ::defaultusers::params |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
683 class { 'website::mysql': |
402 | 684 mysqluser => $::defaultusers::params::mysql_user, |
685 mysqlpassword => $::defaultusers::params::mysql_password, | |
24
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
686 mysqlprefix => $mysqlpackage, |
204330fea19a
Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
687 mysqlsuffix => $mysqlsuffix, |
110 | 688 phpsuffix => $php_suffix, |
393
a948419a23b1
Fix MySQL package names on Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
390
diff
changeset
|
689 phpmysqlsuffix => $phpmysqlsuffix |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
690 } |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
691 |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
692 # Additional supporting directories that aren't served as sites |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
693 file { [ '/srv/sites/errorhandling', '/srv/sites/private', '/srv/cms' ]: |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
694 ensure => directory, |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
695 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
696 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
697 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
698 class ibboardvpsnode ( |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
699 $primary_ip, |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
700 $gateway_ip = undef, |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
701 $proxy_4to6_ip_prefix = undef, |
279 | 702 $proxy_upstream = undef, |
326 | 703 $nat64_ranges = [], |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
704 $mailserver, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
705 $imapserver, |
326 | 706 $mailrelays = [], |
35
1bb941522ebf
Handle differences in firewalling between ASO (using APF) and most other hosts (using iptables)
IBBoard <dev@ibboard.co.uk>
parents:
32
diff
changeset
|
707 $firewall_cmd = 'iptables', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
708 ){ |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
709 class { 'basevpsnode': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
710 primary_ip => $primary_ip, |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
711 gateway_ip => $gateway_ip, |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
712 proxy_4to6_ip_prefix => $proxy_4to6_ip_prefix, |
279 | 713 proxy_upstream => $proxy_upstream, |
326 | 714 nat64_ranges => $nat64_ranges, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
715 mailserver => $mailserver, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
716 imapserver => $imapserver, |
326 | 717 mailrelays => $mailrelays, |
35
1bb941522ebf
Handle differences in firewalling between ASO (using APF) and most other hosts (using iptables)
IBBoard <dev@ibboard.co.uk>
parents:
32
diff
changeset
|
718 firewall_cmd => $firewall_cmd, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
719 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
720 |
267
edeedd13262c
Set a sensible default timezone for VPS
IBBoard <dev@ibboard.co.uk>
parents:
266
diff
changeset
|
721 # Set timezone to something sensible |
edeedd13262c
Set a sensible default timezone for VPS
IBBoard <dev@ibboard.co.uk>
parents:
266
diff
changeset
|
722 file { "/etc/localtime": |
edeedd13262c
Set a sensible default timezone for VPS
IBBoard <dev@ibboard.co.uk>
parents:
266
diff
changeset
|
723 ensure => 'link', |
edeedd13262c
Set a sensible default timezone for VPS
IBBoard <dev@ibboard.co.uk>
parents:
266
diff
changeset
|
724 target => '/usr/share/zoneinfo/Europe/London', |
edeedd13262c
Set a sensible default timezone for VPS
IBBoard <dev@ibboard.co.uk>
parents:
266
diff
changeset
|
725 } |
edeedd13262c
Set a sensible default timezone for VPS
IBBoard <dev@ibboard.co.uk>
parents:
266
diff
changeset
|
726 |
456
66e0e8f9e82a
Ensure that at least a blank Great Firewall file exists
IBBoard <dev@ibboard.co.uk>
parents:
455
diff
changeset
|
727 file { "${apache::conf_dir}/conf.d/greatfirewallagainstchina.conf": |
66e0e8f9e82a
Ensure that at least a blank Great Firewall file exists
IBBoard <dev@ibboard.co.uk>
parents:
455
diff
changeset
|
728 ensure => file, |
66e0e8f9e82a
Ensure that at least a blank Great Firewall file exists
IBBoard <dev@ibboard.co.uk>
parents:
455
diff
changeset
|
729 } |
66e0e8f9e82a
Ensure that at least a blank Great Firewall file exists
IBBoard <dev@ibboard.co.uk>
parents:
455
diff
changeset
|
730 |
446
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
731 # Debian doesn't handle sensible depends like module names because of the underscore |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
732 # So we need to use the package name |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
733 package { "mod_cspnonce": |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
734 name => $osfamily == 'Debian' ? { true => "libapache2-mod-cspnonce", default => "mod_cspnonce" }, |
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
735 ensure => installed, |
410 | 736 } |
737 | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
738 # Common modules used by multiple sites (mod_auth_basic is safe because we HTTPS all the things) |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
739 $mods = [ |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
740 'auth_basic', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
741 'authn_core', |
146
816e35f86a5d
Remove mod_auth_token and replace with mod_xsendfile
IBBoard <dev@ibboard.co.uk>
parents:
145
diff
changeset
|
742 'authn_file', |
816e35f86a5d
Remove mod_auth_token and replace with mod_xsendfile
IBBoard <dev@ibboard.co.uk>
parents:
145
diff
changeset
|
743 'authz_user', |
816e35f86a5d
Remove mod_auth_token and replace with mod_xsendfile
IBBoard <dev@ibboard.co.uk>
parents:
145
diff
changeset
|
744 'deflate', |
410 | 745 'xsendfile', |
746 'cspnonce' | |
146
816e35f86a5d
Remove mod_auth_token and replace with mod_xsendfile
IBBoard <dev@ibboard.co.uk>
parents:
145
diff
changeset
|
747 ] |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
748 apache::mod { |
146
816e35f86a5d
Remove mod_auth_token and replace with mod_xsendfile
IBBoard <dev@ibboard.co.uk>
parents:
145
diff
changeset
|
749 $mods:; |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
750 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
751 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
752 #Configure our sites, using templates for the custom fragments where the extra content is too long |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
753 class { "devsite": |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
754 proxy_4to6_ip => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:01", default => undef } |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
755 } |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
756 class { "adminsite": |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
757 proxy_4to6_ip => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:02", default => undef } |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
758 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
759 website::https::multitld { 'www.ibboard': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
760 proxy_4to6_ip => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:03", default => undef }, |
246 | 761 custom_fragment => template("privat/apache/ibboard.fragment"), |
157
c6b1b42f3e4b
Move all sites to separate LetsEncrypt certs to make adding future domains easier
IBBoard <dev@ibboard.co.uk>
parents:
154
diff
changeset
|
762 letsencrypt_name => 'ibboard.co.uk', |
236
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
763 csp_override => { |
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
764 "report-uri" => "https://ibboard.report-uri.com/r/d/csp/enforce", |
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
765 "default-src" => "'none'", |
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
766 "img-src" => "'self' https://live.staticflickr.com/", |
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
767 "script-src" => "'self'", |
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
768 "style-src" => "'self'", |
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
769 "font-src" => "'self'", |
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
770 "form-action" => "'self'", |
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
771 "connect-src" => "'self'", |
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
772 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
773 } |
374
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
774 website::https::redir { 'mail.ibboard.co.uk': |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
775 proxy_4to6_ip => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:03", default => undef }, |
374
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
776 redir => 'https://ibboard.co.uk/', |
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
777 docroot => "${website::basedir}/ibboard", |
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
778 letsencrypt_name => 'ibboard.co.uk', |
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
779 separate_log => true, |
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
780 } |
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
781 website::https::redir { 'imap.ibboard.co.uk': |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
782 proxy_4to6_ip => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:03", default => undef }, |
374
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
783 redir => 'https://ibboard.co.uk/', |
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
784 docroot => "${website::basedir}/ibboard", |
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
785 letsencrypt_name => 'ibboard.co.uk', |
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
786 separate_log => true, |
5f4fc00f8189
Add mail and imap redirect websites
IBBoard <dev@ibboard.co.uk>
parents:
364
diff
changeset
|
787 } |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
788 class { "hiveworldterrasite": |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
789 proxy_4to6_ip => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:04", default => undef } |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
790 } |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
791 class { "bdstrikesite": |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
792 proxy_4to6_ip => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:05", default => undef } |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
793 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
794 website::https::multitld { 'www.abiknight': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
795 proxy_4to6_ip => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:06", default => undef }, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
796 custom_fragment => "$website::htmlphpfragment |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
797 ErrorDocument 404 /error.php", |
157
c6b1b42f3e4b
Move all sites to separate LetsEncrypt certs to make adding future domains easier
IBBoard <dev@ibboard.co.uk>
parents:
154
diff
changeset
|
798 letsencrypt_name => 'abiknight.co.uk', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
799 } |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
800 class { "webmailpimsite": |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
801 proxy_4to6_ip_pim => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:08", default => undef }, |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
802 proxy_4to6_ip_webmail => $proxy_4to6_ip_prefix != undef ? { true => "$proxy_4to6_ip_prefix:09", default => undef }, |
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
803 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
804 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
805 |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
806 class adminsite ($proxy_4to6_ip) { |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
807 apache::mod { 'info':; 'status':; 'cgi':; } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
808 website::https::multitld { 'admin.ibboard': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
809 proxy_4to6_ip => $proxy_4to6_ip, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
810 force_no_index => false, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
811 ssl_ca_chain => '', |
422 | 812 csp_override => { |
813 "report-uri" => "https://ibboard.report-uri.com/r/d/csp/enforce", | |
814 "img-src" => "'self' data:", | |
815 }, | |
426 | 816 csp_report_override => { |
817 "img-src" => "'self' data:", | |
818 }, | |
246 | 819 custom_fragment => template("privat/apache/admin.fragment"), |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
820 } |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
821 if $osfamily == 'RedHat' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
822 $cron_user = 'apache' |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
823 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
824 elsif $osfamily == 'Debian' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
825 $cron_user = 'www-data' |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
826 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
827 cron { 'loadavg': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
828 command => '/usr/local/bin/run-loadavg-logger', |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
829 user => $cron_user, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
830 minute => '*/6' |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
831 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
832 cron { 'awstats': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
833 command => '/usr/local/bin/update-awstats > /srv/sites/admin/awstats.log', |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
834 user => $cron_user, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
835 hour => '*/6', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
836 minute => '0' |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
837 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
838 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
839 |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
840 class hiveworldterrasite ($proxy_4to6_ip) { |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
841 website::https::multitld { 'www.hiveworldterra': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
842 proxy_4to6_ip => $proxy_4to6_ip, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
843 force_no_www => false, |
157
c6b1b42f3e4b
Move all sites to separate LetsEncrypt certs to make adding future domains easier
IBBoard <dev@ibboard.co.uk>
parents:
154
diff
changeset
|
844 letsencrypt_name => 'hiveworldterra.co.uk', |
246 | 845 custom_fragment => template("privat/apache/hwt.fragment"), |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
846 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
847 website::https::multitld { 'forums.hiveworldterra': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
848 proxy_4to6_ip => $proxy_4to6_ip, |
331
f69e2d197302
Separate some certs to make migration easier
IBBoard <dev@ibboard.co.uk>
parents:
330
diff
changeset
|
849 letsencrypt_name => 'forums.hiveworldterra.co.uk', |
246 | 850 custom_fragment => template("privat/apache/forums.fragment"), |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
851 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
852 website::https::multitld { 'skins.hiveworldterra': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
853 proxy_4to6_ip => $proxy_4to6_ip, |
334 | 854 letsencrypt_name => 'skins.hiveworldterra.co.uk', |
246 | 855 custom_fragment => template("privat/apache/skins.fragment"), |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
856 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
857 website::https::redir { 'hiveworldterra.ibboard.co.uk': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
858 proxy_4to6_ip => $proxy_4to6_ip, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
859 redir => 'https://www.hiveworldterra.co.uk/', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
860 docroot => "${website::basedir}/hiveworldterra", |
334 | 861 letsencrypt_name => 'hiveworldterra.ibboard.co.uk', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
862 separate_log => true, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
863 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
864 } |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
865 class bdstrikesite ($proxy_4to6_ip) { |
331
f69e2d197302
Separate some certs to make migration easier
IBBoard <dev@ibboard.co.uk>
parents:
330
diff
changeset
|
866 website::https::multitld { 'www.bdstrike': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
867 proxy_4to6_ip => $proxy_4to6_ip, |
145 | 868 docroot_owner => $defaultusers::secondary_user, |
869 docroot_group => 'editors', | |
157
c6b1b42f3e4b
Move all sites to separate LetsEncrypt certs to make adding future domains easier
IBBoard <dev@ibboard.co.uk>
parents:
154
diff
changeset
|
870 letsencrypt_name => 'bdstrike.co.uk', |
246 | 871 custom_fragment => template("privat/apache/bdstrike.fragment"), |
411
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
872 csp_override => { |
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
873 "report-uri" => "https://ibboard.report-uri.com/r/d/csp/enforce", |
364
8224f42ee05b
Expand BDStrike CSP to allow more styling and fonts
IBBoard <dev@ibboard.co.uk>
parents:
362
diff
changeset
|
874 "font-src" => "'self' https://fonts.gstatic.com/ data:", |
446
ba3c446d5a47
Update config to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
439
diff
changeset
|
875 "img-src" => "'self' https://secure.gravatar.com/ https://ps.w.org/ https://s.w.org/ data:", |
411
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
876 "style-src" => "'self' https://fonts.googleapis.com/ 'unsafe-inline'", |
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
877 "connect-src" => "'self' https://www.sandbox.paypal.com/ https://www.paypal.com/", |
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
878 "frame-ancestors" => "'self'" |
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
879 }, |
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
880 csp_report_override => { |
422 | 881 "report-uri" => "https://ibboard.report-uri.com/r/d/csp/reportOnly", |
411
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
882 "font-src" => "'self' https://fonts.gstatic.com/ data:", # TODO: What's generating it? |
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
883 "img-src" => "'self' https://secure.gravatar.com/ data:", |
426 | 884 "style-src" => "'self' https://fonts.googleapis.com/ 'nonce-%{CSP_NONCE}e' 'unsafe-hashes' 'sha256-anQSeQoEnQnBulZOQkDOFf+e6xBIGmqh7M8YFT992co=' 'sha256-zJDyuABAg68wtWDFyIh+RRe+6Vm/r+BLwaNRCGNVyXI=' 'sha256-qMalr/MPLUDW4lX/rq/cGp1Eu/H0cu0Yg98pdu69Jxs=' 'sha256-mshqJ+hidJMRDeNLHknuDAeYLOPg2OTIIA3nZmHgi9U=' 'sha256-YnRUd/QjP/NuFgfjMHhNfMCqXh0RQIGdvQfMCOf6qkw=' 'sha256-EwdiFJgqhefinoeAymrWxOYW4kza2Ekos5MY0PlXYI0=' 'sha256-G4K9vh8e+37+l69S+lHTyX3CfcK95mQUgyxYPCb7uME=' 'sha256-t6oewASd7J1vBg5mQtX4hl8bg8FeegYFM3scKLIhYUc=' 'sha256-mAQYxa3mIYqoLBrm1zLu6sLajr8vUHVFLYNpl6dAakM=' 'sha256-A8foknjCsFBi1PlRehOrHq0pVySigUurqAUgZ2y2U8c=' 'sha256-biLFinpqYMtWHmXfkA1BPeCY0/fNt46SAZ+BBk5YUog=' 'sha256-WzSByVQ8yW/DKrr77TWVt7WEMzueRcfJZImOkjTBKmc=' 'sha256-efof3agGBAL/yN8TplyNbLEgDZ3wIGMK3UMYbe8slkA='", |
411
83f2e944a43f
Set security settings on BDStrike.co.uk
IBBoard <dev@ibboard.co.uk>
parents:
410
diff
changeset
|
885 "connect-src" => "'self' https://www.sandbox.paypal.com/ https://www.paypal.com/", |
236
4519b727cc4c
Make Content-Security-Policy cleaner and easier to set
IBBoard <dev@ibboard.co.uk>
parents:
235
diff
changeset
|
886 }, |
145 | 887 } |
157
c6b1b42f3e4b
Move all sites to separate LetsEncrypt certs to make adding future domains easier
IBBoard <dev@ibboard.co.uk>
parents:
154
diff
changeset
|
888 |
235
e602c5f974ac
Make a cron job for updating Wordpress
IBBoard <dev@ibboard.co.uk>
parents:
200
diff
changeset
|
889 cron { 'wordpress_cron': |
e602c5f974ac
Make a cron job for updating Wordpress
IBBoard <dev@ibboard.co.uk>
parents:
200
diff
changeset
|
890 # Run "php -f wp-cron.php" on a schedule so that we can auto-update |
e602c5f974ac
Make a cron job for updating Wordpress
IBBoard <dev@ibboard.co.uk>
parents:
200
diff
changeset
|
891 # without giving Apache full write access! |
e602c5f974ac
Make a cron job for updating Wordpress
IBBoard <dev@ibboard.co.uk>
parents:
200
diff
changeset
|
892 command => "/usr/local/bin/bdstrike-cron", |
459
d7af40e44502
Use Apache for BDStrike cron to fix post-update warnings
IBBoard <dev@ibboard.co.uk>
parents:
458
diff
changeset
|
893 user => $website::apache_user, |
235
e602c5f974ac
Make a cron job for updating Wordpress
IBBoard <dev@ibboard.co.uk>
parents:
200
diff
changeset
|
894 minute => '*/15', |
e602c5f974ac
Make a cron job for updating Wordpress
IBBoard <dev@ibboard.co.uk>
parents:
200
diff
changeset
|
895 } |
145 | 896 } |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
897 class devsite ($proxy_4to6_ip) { |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
898 if $operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '8') >= 0 { |
418
dd12bb713260
Fix mod_wsgi package install on CentOS
IBBoard <dev@ibboard.co.uk>
parents:
417
diff
changeset
|
899 $package_name = 'python3-mod_wsgi' |
dd12bb713260
Fix mod_wsgi package install on CentOS
IBBoard <dev@ibboard.co.uk>
parents:
417
diff
changeset
|
900 $mod_path = 'mod_wsgi_python3.so' |
261
c3ecb1e58713
Fix more CentOS 7 vs 8 differences
IBBoard <dev@ibboard.co.uk>
parents:
258
diff
changeset
|
901 } else { |
418
dd12bb713260
Fix mod_wsgi package install on CentOS
IBBoard <dev@ibboard.co.uk>
parents:
417
diff
changeset
|
902 $package_name = undef |
dd12bb713260
Fix mod_wsgi package install on CentOS
IBBoard <dev@ibboard.co.uk>
parents:
417
diff
changeset
|
903 $mod_path = undef |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
904 } |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
905 class { 'apache::mod::wsgi': |
418
dd12bb713260
Fix mod_wsgi package install on CentOS
IBBoard <dev@ibboard.co.uk>
parents:
417
diff
changeset
|
906 package_name => $package_name, |
dd12bb713260
Fix mod_wsgi package install on CentOS
IBBoard <dev@ibboard.co.uk>
parents:
417
diff
changeset
|
907 mod_path => $mod_path, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
908 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
909 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
910 website::https::multitld { 'dev.ibboard': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
911 proxy_4to6_ip => $proxy_4to6_ip, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
912 #Make sure we're the first one hit for the tiny fraction of "no support" cases we care about (potentially Python for Mercurial!) |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
913 # http://en.wikipedia.org/wiki/Server_Name_Indication#No_support |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
914 priority => 1, |
157
c6b1b42f3e4b
Move all sites to separate LetsEncrypt certs to make adding future domains easier
IBBoard <dev@ibboard.co.uk>
parents:
154
diff
changeset
|
915 letsencrypt_name => 'dev.ibboard.co.uk', |
246 | 916 custom_fragment => template("privat/apache/dev.fragment"), |
281
af7df930a670
Add 4-to-6 proxy and mod_remoteip setup
IBBoard <dev@ibboard.co.uk>
parents:
279
diff
changeset
|
917 proxy_fragment => template("privat/apache/dev-proxy.fragment"), |
52
be1e9773a12c
Mercurial repo versions index.php files etc, so removing index.php breaks things!
IBBoard <dev@ibboard.co.uk>
parents:
44
diff
changeset
|
918 force_no_index => false, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
919 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
920 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
921 |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
922 class webmailpimsite ($proxy_4to6_ip_pim, $proxy_4to6_ip_webmail) { |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
923 # Webmail and Personal Information Management (PIM) sites |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
924 website::https { 'webmail.ibboard.co.uk': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
925 proxy_4to6_ip => $proxy_4to6_ip_webmail, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
926 force_no_index => false, |
414
23eac935cffa
Switch to LetsEncrypt on Webmail
IBBoard <dev@ibboard.co.uk>
parents:
413
diff
changeset
|
927 letsencrypt_name => 'webmail.ibboard.co.uk', |
246 | 928 custom_fragment => template("privat/apache/webmail.fragment"), |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
929 } |
396
e93588ec1ce3
Use "param" variables for settings instead of conditions
IBBoard <dev@ibboard.co.uk>
parents:
393
diff
changeset
|
930 include ::apache::params |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
931 website::https { 'pim.ibboard.co.uk': |
284
9431aec4d998
Switch to using IPv6 prefix and IP per site
IBBoard <dev@ibboard.co.uk>
parents:
281
diff
changeset
|
932 proxy_4to6_ip => $proxy_4to6_ip_pim, |
396
e93588ec1ce3
Use "param" variables for settings instead of conditions
IBBoard <dev@ibboard.co.uk>
parents:
393
diff
changeset
|
933 docroot_owner => $apache::params::user, |
242
7d8e664ebcc9
Change owner/group on Nextcloud for easy upgrade
IBBoard <dev@ibboard.co.uk>
parents:
241
diff
changeset
|
934 docroot_group => 'editors', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
935 force_no_index => false, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
936 lockdown_requests => false, |
429
fa3093f2dc8e
Migrate NextCloud to LetsEncrypt
IBBoard <dev@ibboard.co.uk>
parents:
426
diff
changeset
|
937 letsencrypt_name => 'pim.ibboard.co.uk', |
265
bf2b8912c414
Make PIM site skip CSP headers - NextCloud manages them
IBBoard <dev@ibboard.co.uk>
parents:
264
diff
changeset
|
938 csp => false, |
bf2b8912c414
Make PIM site skip CSP headers - NextCloud manages them
IBBoard <dev@ibboard.co.uk>
parents:
264
diff
changeset
|
939 csp_report => false, |
246 | 940 custom_fragment => template("privat/apache/pim.fragment"), |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
941 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
942 cron { 'owncloudcron': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
943 command => "/usr/local/bin/owncloud-cron", |
402 | 944 user => $apache::params::user, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
945 minute => '*/15', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
946 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
947 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
948 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
949 class email ( |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
950 $mailserver, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
951 $imapserver, |
311
51d3748f8112
Configure Dovecot (IMAP) for PROXY protocol use
IBBoard <dev@ibboard.co.uk>
parents:
310
diff
changeset
|
952 $mailserver_ip, |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
953 $proxy_ip = undef, |
311
51d3748f8112
Configure Dovecot (IMAP) for PROXY protocol use
IBBoard <dev@ibboard.co.uk>
parents:
310
diff
changeset
|
954 $proxy_upstream = [], |
326 | 955 $nat64_ranges = [], |
956 $mailrelays = [], | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
957 ){ |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
958 class { 'postfix': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
959 mailserver => $mailserver, |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
960 mailserver_ip => $mailserver_ip, |
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
961 mailserver_proxy => $proxy_ip, |
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
962 proxy_upstream => $proxy_upstream, |
326 | 963 mailrelays => $mailrelays, |
964 nat64_ranges => $nat64_ranges, | |
317
2a20a5b7f65a
Swap IPv6 Postfix to "all" protocols to support PROXY
IBBoard <dev@ibboard.co.uk>
parents:
313
diff
changeset
|
965 protocols => $mailserver_ip =~ Stdlib::IP::Address::V6 ? { true => 'all', default => 'ipv4' }, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
966 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
967 class { 'dovecot': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
968 imapserver => $imapserver, |
311
51d3748f8112
Configure Dovecot (IMAP) for PROXY protocol use
IBBoard <dev@ibboard.co.uk>
parents:
310
diff
changeset
|
969 imapserver_ip => $mailserver_ip, |
313
49e66019faf7
Configure Postfix for IPv6 w/proxy
IBBoard <dev@ibboard.co.uk>
parents:
311
diff
changeset
|
970 imapserver_proxy => $proxy_ip, |
311
51d3748f8112
Configure Dovecot (IMAP) for PROXY protocol use
IBBoard <dev@ibboard.co.uk>
parents:
310
diff
changeset
|
971 proxy_upstream => $proxy_upstream, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
972 } |
177
1b605c38b375
Add missing dependencies for SpamAssassin rules
IBBoard <dev@ibboard.co.uk>
parents:
176
diff
changeset
|
973 # Unspecified SpamAssassin config dependencies that started |
1b605c38b375
Add missing dependencies for SpamAssassin rules
IBBoard <dev@ibboard.co.uk>
parents:
176
diff
changeset
|
974 # showing up as errors in our logs |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
975 if $osfamily == 'RedHat' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
976 $spamassassin_deps = ['perl-File-MimeInfo'] |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
977 $spamassassin_dir = '/etc/mail/spamassassin/' |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
978 $amavis_config = '/etc/amavisd/amavisd.conf' |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
979 $amavis_rundir = '/var/run/amavisd' |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
980 $amavis_spooldir = '/var/spool/amavisd' |
453
dc725b618258
Fix Amavis quarantine directory
IBBoard <dev@ibboard.co.uk>
parents:
449
diff
changeset
|
981 $amavis_quarantinedir = '$MYHOME/quarantine' |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
982 $amavis_service = 'amavisd' |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
983 # CentOS has a Clam service, but we call on demand (Ubuntu doesn't have a service) |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
984 service { 'clamd@amavisd': |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
985 ensure => 'stopped', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
986 enable=> 'mask', |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
987 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
988 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
989 elsif $osfamily == 'Debian' { |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
990 $spamassassin_deps = ['libfile-mimeinfo-perl'] |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
991 $spamassassin_dir = '/etc/spamassassin/' |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
992 $amavis_config = '/etc/amavis/conf.d/60-puppeted' |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
993 $amavis_rundir = '/var/run/amavis' |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
994 $amavis_spooldir = '/var/lib/amavis' |
453
dc725b618258
Fix Amavis quarantine directory
IBBoard <dev@ibboard.co.uk>
parents:
449
diff
changeset
|
995 $amavis_quarantinedir = '$MYHOME/virusmails' |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
996 $amavis_service = 'amavis' |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
997 } |
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
998 package { $spamassassin_deps: |
177
1b605c38b375
Add missing dependencies for SpamAssassin rules
IBBoard <dev@ibboard.co.uk>
parents:
176
diff
changeset
|
999 ensure => installed, |
1b605c38b375
Add missing dependencies for SpamAssassin rules
IBBoard <dev@ibboard.co.uk>
parents:
176
diff
changeset
|
1000 } |
140
6eef7cec8658
Remove ClamAV from server config
IBBoard <dev@ibboard.co.uk>
parents:
139
diff
changeset
|
1001 package { [ 'amavisd-new' ]: |
85 | 1002 ensure => installed, |
1003 tag => 'av', | |
1004 } | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
1005 service { $amavis_service: |
86
4f59d2fcd521
Make sure that Amavis daemon is running so mail gets delivered after reboot!
IBBoard <dev@ibboard.co.uk>
parents:
85
diff
changeset
|
1006 ensure => 'running', |
4f59d2fcd521
Make sure that Amavis daemon is running so mail gets delivered after reboot!
IBBoard <dev@ibboard.co.uk>
parents:
85
diff
changeset
|
1007 enable => 'true', |
4f59d2fcd521
Make sure that Amavis daemon is running so mail gets delivered after reboot!
IBBoard <dev@ibboard.co.uk>
parents:
85
diff
changeset
|
1008 } |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
1009 file { $amavis_config: |
85 | 1010 ensure => present, |
449
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
1011 content => epp('privat/postfix/amavis.conf.epp', |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
1012 { |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
1013 fqdn => $::fqdn, |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
1014 rundir => $amavis_rundir, |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
1015 spooldir => $amavis_spooldir, |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
1016 quarantinedir => $amavis_quarantinedir, |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
1017 } |
4a6ad700cded
Update config for real Raspberry Pi host
IBBoard <dev@ibboard.co.uk>
parents:
448
diff
changeset
|
1018 ), |
85 | 1019 tag => 'av', |
1020 } | |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
1021 file { "${spamassassin_dir}local.cf": |
163
4e53d77fa586
Manage SpamAssassin local config
IBBoard <dev@ibboard.co.uk>
parents:
162
diff
changeset
|
1022 ensure => present, |
4e53d77fa586
Manage SpamAssassin local config
IBBoard <dev@ibboard.co.uk>
parents:
162
diff
changeset
|
1023 source => 'puppet:///private/postfix/spamassassin-local.cf', |
4e53d77fa586
Manage SpamAssassin local config
IBBoard <dev@ibboard.co.uk>
parents:
162
diff
changeset
|
1024 tag => 'av', |
4e53d77fa586
Manage SpamAssassin local config
IBBoard <dev@ibboard.co.uk>
parents:
162
diff
changeset
|
1025 } |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
1026 file { "${spamassassin_dir}ole2macro.cf": |
142
dae1088dd218
Add OLE detection to SpamAssassin without ClamAV
IBBoard <dev@ibboard.co.uk>
parents:
141
diff
changeset
|
1027 ensure => present, |
dae1088dd218
Add OLE detection to SpamAssassin without ClamAV
IBBoard <dev@ibboard.co.uk>
parents:
141
diff
changeset
|
1028 source => 'puppet:///common/ole2macro.cf', |
dae1088dd218
Add OLE detection to SpamAssassin without ClamAV
IBBoard <dev@ibboard.co.uk>
parents:
141
diff
changeset
|
1029 tag => 'av', |
dae1088dd218
Add OLE detection to SpamAssassin without ClamAV
IBBoard <dev@ibboard.co.uk>
parents:
141
diff
changeset
|
1030 } |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
1031 file { "${spamassassin_dir}ole2macro.pm": |
142
dae1088dd218
Add OLE detection to SpamAssassin without ClamAV
IBBoard <dev@ibboard.co.uk>
parents:
141
diff
changeset
|
1032 ensure => present, |
dae1088dd218
Add OLE detection to SpamAssassin without ClamAV
IBBoard <dev@ibboard.co.uk>
parents:
141
diff
changeset
|
1033 source => 'puppet:///common/spamassassin-vba-macro-master/ole2macro.pm', |
dae1088dd218
Add OLE detection to SpamAssassin without ClamAV
IBBoard <dev@ibboard.co.uk>
parents:
141
diff
changeset
|
1034 tag => 'av', |
dae1088dd218
Add OLE detection to SpamAssassin without ClamAV
IBBoard <dev@ibboard.co.uk>
parents:
141
diff
changeset
|
1035 } |
85 | 1036 Package<| tag == 'av' |> -> File<| tag == 'av' |> |
87
6be21a984126
Make sure that config file changes for changes trigger a reload
IBBoard <dev@ibboard.co.uk>
parents:
86
diff
changeset
|
1037 File<| tag == 'av' |> { |
390
df5ad1612af7
Adapt configs to support Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
385
diff
changeset
|
1038 notify => Service[$amavis_service], |
87
6be21a984126
Make sure that config file changes for changes trigger a reload
IBBoard <dev@ibboard.co.uk>
parents:
86
diff
changeset
|
1039 } |
125
ca711ab45f17
Schedule Postwhite to run regularly
IBBoard <dev@ibboard.co.uk>
parents:
122
diff
changeset
|
1040 cron { 'Postwhite': |
129
16a931df5fd7
Filter what we see in Postwhite cron output
IBBoard <dev@ibboard.co.uk>
parents:
128
diff
changeset
|
1041 command => "/usr/local/bin/postwhite 2>&1| grep -vE '^(Starting|Recursively|Getting|Querying|Removing|Sorting|$)'", |
125
ca711ab45f17
Schedule Postwhite to run regularly
IBBoard <dev@ibboard.co.uk>
parents:
122
diff
changeset
|
1042 user => 'root', |
ca711ab45f17
Schedule Postwhite to run regularly
IBBoard <dev@ibboard.co.uk>
parents:
122
diff
changeset
|
1043 weekday => 0, |
128
379089631403
Fix rookie cron mistake - don't run Postwhite EVERY MINUTE!
IBBoard <dev@ibboard.co.uk>
parents:
126
diff
changeset
|
1044 hour => 2, |
379089631403
Fix rookie cron mistake - don't run Postwhite EVERY MINUTE!
IBBoard <dev@ibboard.co.uk>
parents:
126
diff
changeset
|
1045 minute => 0, |
125
ca711ab45f17
Schedule Postwhite to run regularly
IBBoard <dev@ibboard.co.uk>
parents:
122
diff
changeset
|
1046 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1047 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1048 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1049 class cronjobs { |
447
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
1050 package { 'cron': |
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
1051 ensure => installed, |
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
1052 name => $operatingsystem == 'Ubuntu' ? { true => 'cron', default => 'cronie' } |
1a9de0661666
Add missing package/dir for minimal Ubuntu
IBBoard <dev@ibboard.co.uk>
parents:
446
diff
changeset
|
1053 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1054 # Add Mutt for scripts that send emails, but stop it clogging the disk by keeping copies of emails |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1055 package { 'mutt': |
131
0dd899a10ee1
Change all "latest" packages to "installed"
IBBoard <dev@ibboard.co.uk>
parents:
129
diff
changeset
|
1056 ensure => installed, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1057 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1058 file { '/etc/Muttrc.local': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1059 content => 'set copy = no', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1060 require => Package['mutt'], |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1061 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1062 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1063 # General server-wide cron jobs |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1064 Cron { user => 'root' } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1065 cron { 'backupalldbs': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1066 command => "/usr/local/bin/backupalldbs", |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1067 monthday => "*/2", |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1068 hour => "4", |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1069 minute => "9" |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1070 } |
323
002203790815
Stop running Great Firewall Against China on IPv6 machines
IBBoard <dev@ibboard.co.uk>
parents:
322
diff
changeset
|
1071 # Only run the Great Firewall Against China on IPv4 (since we don't have an IPv6 list |
002203790815
Stop running Great Firewall Against China on IPv6 machines
IBBoard <dev@ibboard.co.uk>
parents:
322
diff
changeset
|
1072 # and the PROXY forwards the IPs to services, but not at the network level) |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1073 cron { 'greatfirewallofchina': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1074 command => '/usr/local/bin/update-great-firewall-of-china', |
323
002203790815
Stop running Great Firewall Against China on IPv6 machines
IBBoard <dev@ibboard.co.uk>
parents:
322
diff
changeset
|
1075 ensure => has_key($facts, 'ipaddress') ? { true => "present", default => "absent" }, |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1076 hour => 3, |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1077 minute => 30 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1078 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1079 cron { 'permissions': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1080 command => '/usr/local/bin/set-permissions', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1081 hour => 3, |
14
534e584f21ce
Tweak time on permission setting script so that it is less likely to clash with LoadAVG run every 6 minutes
IBBoard <dev@ibboard.co.uk>
parents:
13
diff
changeset
|
1082 minute => 2 |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1083 } |
55
ce8eaaca6a34
Update firewalling so that we block the right ports when using iptables directly
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
1084 # Since we're only managing the local server, use our script that wraps "puppet apply" instead of PuppetMaster |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1085 cron { 'puppet': |
268
9f054191b9db
Filter new log line from puppet-apply output
IBBoard <dev@ibboard.co.uk>
parents:
267
diff
changeset
|
1086 command => '/usr/local/bin/puppet-apply | grep -v "Compiled catalog for\|Finished catalog run in\|Applied catalog in"', |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1087 hour => '*/6', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1088 minute => 5 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1089 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1090 cron { 'purgecaches': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1091 command => "/usr/local/bin/purge-caches", |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1092 hour => '4', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1093 minute => '15', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1094 weekday => '1', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1095 } |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1096 # Notify of uncommitted files |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1097 cron { 'check-mercurial-committed': |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1098 command => "/usr/local/bin/check-hg-status", |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1099 hour => '4', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1100 minute => '20', |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1101 weekday => '0-6/3', #Sunday, Wednesday and Saturday morning |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1102 } |
93
74678cd7a200
Run cron job to notify of available updates
IBBoard <dev@ibboard.co.uk>
parents:
91
diff
changeset
|
1103 # Notify of available updates |
74678cd7a200
Run cron job to notify of available updates
IBBoard <dev@ibboard.co.uk>
parents:
91
diff
changeset
|
1104 cron { 'check-yum-updates': |
455
a32771c91043
Switch updates available/restart required to script
IBBoard <dev@ibboard.co.uk>
parents:
454
diff
changeset
|
1105 ensure => absent, |
a32771c91043
Switch updates available/restart required to script
IBBoard <dev@ibboard.co.uk>
parents:
454
diff
changeset
|
1106 } |
a32771c91043
Switch updates available/restart required to script
IBBoard <dev@ibboard.co.uk>
parents:
454
diff
changeset
|
1107 cron { 'check-for-updates': |
a32771c91043
Switch updates available/restart required to script
IBBoard <dev@ibboard.co.uk>
parents:
454
diff
changeset
|
1108 command => '/usr/local/bin/check-updates', |
93
74678cd7a200
Run cron job to notify of available updates
IBBoard <dev@ibboard.co.uk>
parents:
91
diff
changeset
|
1109 hour => '4', |
74678cd7a200
Run cron job to notify of available updates
IBBoard <dev@ibboard.co.uk>
parents:
91
diff
changeset
|
1110 minute => '30', |
74678cd7a200
Run cron job to notify of available updates
IBBoard <dev@ibboard.co.uk>
parents:
91
diff
changeset
|
1111 weekday => '0-6/3', #Sunday, Wednesday and Saturday morning |
74678cd7a200
Run cron job to notify of available updates
IBBoard <dev@ibboard.co.uk>
parents:
91
diff
changeset
|
1112 } |
97
b69e3f6708d6
Add another regular command to check that we've not got services requiring a restart
IBBoard <dev@ibboard.co.uk>
parents:
96
diff
changeset
|
1113 # And check whether anything needs restarting |
b69e3f6708d6
Add another regular command to check that we've not got services requiring a restart
IBBoard <dev@ibboard.co.uk>
parents:
96
diff
changeset
|
1114 cron { 'check-needs-restarting': |
455
a32771c91043
Switch updates available/restart required to script
IBBoard <dev@ibboard.co.uk>
parents:
454
diff
changeset
|
1115 command => '/usr/local/bin/needs-restarting', |
97
b69e3f6708d6
Add another regular command to check that we've not got services requiring a restart
IBBoard <dev@ibboard.co.uk>
parents:
96
diff
changeset
|
1116 hour => '4', |
b69e3f6708d6
Add another regular command to check that we've not got services requiring a restart
IBBoard <dev@ibboard.co.uk>
parents:
96
diff
changeset
|
1117 minute => '45', |
b69e3f6708d6
Add another regular command to check that we've not got services requiring a restart
IBBoard <dev@ibboard.co.uk>
parents:
96
diff
changeset
|
1118 weekday => '0-6/3', #Sunday, Wednesday and Saturday morning |
b69e3f6708d6
Add another regular command to check that we've not got services requiring a restart
IBBoard <dev@ibboard.co.uk>
parents:
96
diff
changeset
|
1119 } |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1120 } |