Initial version of process accounting module.
This commit is contained in:
parent
d6f5b35ff7
commit
f91faebb7e
1 changed files with 63 additions and 0 deletions
63
psacct/manifests/init.pp
Normal file
63
psacct/manifests/init.pp
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
|
||||||
|
# Enable process accounting.
|
||||||
|
#
|
||||||
|
class psacct {
|
||||||
|
|
||||||
|
case $operatingsystem {
|
||||||
|
fedora,centos: {
|
||||||
|
include psacct::linux
|
||||||
|
}
|
||||||
|
openbsd: {
|
||||||
|
include psacct::openbsd
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
fail("psacct module not supported in ${operatingsystem}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Enable process accounting on Linux hosts.
|
||||||
|
#
|
||||||
|
class psacct::linux {
|
||||||
|
|
||||||
|
package { "psacct":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
service { "psacct":
|
||||||
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
|
hasstatus => true,
|
||||||
|
require => Package["psacct"],
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Enable process accounting on OpenBSD hosts.
|
||||||
|
#
|
||||||
|
class psacct::openbsd {
|
||||||
|
|
||||||
|
file { "/var/account/acct":
|
||||||
|
ensure => present,
|
||||||
|
mode => 0644,
|
||||||
|
owner => root,
|
||||||
|
group => wheel,
|
||||||
|
notify => Exec["accton"],
|
||||||
|
}
|
||||||
|
|
||||||
|
service { "accounting":
|
||||||
|
enable => true,
|
||||||
|
require => File["/var/account/acct"],
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "accton":
|
||||||
|
command => "accton /var/account/acct",
|
||||||
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
|
user => root,
|
||||||
|
refreshonly => true,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue