Maybe there is no need to quote this anymore
[mirror/dsa-puppet.git] / modules / stunnel4 / manifests / init.pp
1 class stunnel4 {
2
3         package { 'stunnel4':
4                 ensure => installed
5         }
6
7         file { '/etc/stunnel':
8                 ensure  => directory,
9                 mode    => '0755',
10         }
11         file { '/etc/init.d/stunnel4':
12                 source => 'puppet:///modules/stunnel4/etc-init.d-stunnel4',
13                 mode   => '0555',
14         }
15         file { '/etc/stunnel/stunnel.conf':
16                 ensure  => absent,
17                 require => Package['stunnel4'],
18         }
19
20         exec { 'enable_stunnel4':
21                 command => 'sed -i -e \'s/^ENABLED=/#&/; $a ENABLED=1 # added by puppet\' /etc/default/stunnel4',
22                 unless  => 'grep -q \'^ENABLED=1\' /etc/default/stunnel4',
23                 require => Package['stunnel4'],
24         }
25         exec { 'kill_file_override':
26                 command => 'sed -i -e \'s/^FILES=/#&/\' /etc/default/stunnel4',
27                 onlyif  => 'grep -q \'^FILES=\' /etc/default/stunnel4',
28                 require => Package['stunnel4'],
29         }
30 }