1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'manifests/acl.pp', line 1
define webmin::acl( $action ) {
Exec {
path => '/bin:/sbin:/usr/sbin:/usr/bin',
require => Package['webmin'],
notify => Service['webmin'],
}
if ( $action == delete ) {
exec { "${action}_${name}":
command => "sed -i 's/ $name //g' /etc/webmin/webmin.acl",
onlyif => "grep ' $name ' /etc/webmin/webmin.acl",
}
} else {}
if ( $action == add ) {
exec { "${action}_${name}":
command => "sed -i 's/$/ $name /g' /etc/webmin/webmin.acl",
unless => "grep ' $name ' /etc/webmin/webmin.acl",
}
} else {}
}
|