15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'modules/pontoon/manifests/sd.pp', line 15
class pontoon::sd (
Stdlib::IP::Address $lb_address,
Array[Stdlib::IP::Address] $nameservers,
Hash[String, Wmflib::Service] $services_config,
) {
package { 'dnsmasq':
ensure => installed,
}
$services = pontoon::service_names($services_config)
file { '/etc/pontoon-sd':
ensure => directory,
}
file { '/etc/pontoon-sd/resolv':
content => template('pontoon/dnsmasq.resolv'),
notify => Exec['dnsmasq-reload'],
}
file { '/etc/pontoon-sd/hosts':
content => template('pontoon/dnsmasq.hosts'),
notify => Exec['dnsmasq-reload'],
}
file { '/etc/dnsmasq.d/pontoon-sd.conf':
content => template('pontoon/dnsmasq.conf'),
notify => Exec['dnsmasq-restart'],
}
service { 'dnsmasq':
ensure => running,
require => Package['dnsmasq'],
}
exec { 'dnsmasq-reload':
command => '/usr/sbin/dnsmasq --test && /bin/systemctl reload dnsmasq',
refreshonly => true,
}
exec { 'dnsmasq-restart':
command => '/usr/sbin/dnsmasq --test && /bin/systemctl restart dnsmasq',
refreshonly => true,
}
}
|