91 lines
1.5 KiB
Puppet
91 lines
1.5 KiB
Puppet
|
|
# Install inetd server.
|
|
#
|
|
# This class is wrapper for installing inetd superserver.
|
|
#
|
|
class inetd::server {
|
|
|
|
case $operatingsystem {
|
|
centos,fedora,ubuntu,debian: {
|
|
include inetd::server::xinetd
|
|
}
|
|
openbsd: {
|
|
include inetd::server::inetd
|
|
}
|
|
default: {
|
|
fail("Inetd module not supported in ${operatingsystem}")
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
# Install xinetd server.
|
|
#
|
|
# This class should not be invoked directly. Instead use
|
|
# inetd::server which installs xinetd or normal inetd
|
|
# depending on running operatingsystem.
|
|
#
|
|
class inetd::server::xinetd {
|
|
|
|
package { "xinetd":
|
|
ensure => installed,
|
|
}
|
|
|
|
service { "xinetd":
|
|
ensure => running,
|
|
enable => true,
|
|
require => Package["xinetd"],
|
|
}
|
|
|
|
}
|
|
|
|
# Install inetd server.
|
|
#
|
|
# This class should not be invoked directly. Instead use
|
|
# inetd::server which installs xinetd or normal inetd
|
|
# depending on running operatingsystem.
|
|
#
|
|
class inetd::server::inetd {
|
|
|
|
service { "inetd":
|
|
ensure => running,
|
|
enable => true,
|
|
}
|
|
|
|
}
|
|
|
|
|
|
# Configure inetd service.
|
|
#
|
|
# === Parameters
|
|
#
|
|
# $name:
|
|
# Service name
|
|
# $ensure:
|
|
# Set to present to enable service and absent to disable.
|
|
#
|
|
# === Sample usage
|
|
#
|
|
# inetd::service { "time-stream":
|
|
# ensure => present,
|
|
# }
|
|
#
|
|
define inetd::service($ensure = present) {
|
|
|
|
case $operatingsystem {
|
|
centos,fedora,ubuntu,debian: {
|
|
service { "${name}":
|
|
enable => $ensure ? {
|
|
present => true,
|
|
absent => false,
|
|
},
|
|
notify => Service["xinetd"],
|
|
}
|
|
}
|
|
default: {
|
|
fail("Inetd module not supported in ${operatingsystem}")
|
|
}
|
|
}
|
|
|
|
}
|