Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update restart and status checking #19

Merged
merged 1 commit into from Jan 23, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 12 additions & 7 deletions manifests/init.pp
Expand Up @@ -10,10 +10,14 @@
# }
#
class xinetd (
$confdir = $xinetd::params::confdir,
$conffile = $xinetd::params::conffile,
$package_name = $xinetd::params::package_name,
$service_name = $xinetd::params::service_name
$confdir = $xinetd::params::confdir,
$conffile = $xinetd::params::conffile,
$package_name = $xinetd::params::package_name,
$service_name = $xinetd::params::service_name,
$service_restart = $xinetd::params::service_restart,
$service_status = $xinetd::params::service_status,
$service_hasrestart = $xinetd::params::service_hasrestart,
$service_hasstatus = $xinetd::params::service_hasstatus,
) inherits xinetd::params {

File {
Expand Down Expand Up @@ -44,9 +48,10 @@
service { $service_name:
ensure => running,
enable => true,
hasrestart => false,
hasstatus => true,
hasrestart => $service_hasrestart,
hasstatus => $service_hasstatus,
restart => $service_restart,
status => $service_status,
require => File[$conffile],
}

}
43 changes: 27 additions & 16 deletions manifests/params.pp
Expand Up @@ -2,28 +2,39 @@

case $::osfamily {
'Debian': {
$confdir = '/etc/xinetd.d'
$conffile = '/etc/xinetd.conf'
$package_name = 'xinetd'
$service_name = 'xinetd'
$confdir = '/etc/xinetd.d'
$conffile = '/etc/xinetd.conf'
$package_name = 'xinetd'
$service_hasrestart = true
$service_hasstatus = false
$service_name = 'xinetd'
$service_restart = "/usr/sbin/service ${service_name} reload"
}
'FreeBSD': {
$confdir = '/usr/local/etc/xinetd.d'
$conffile = '/usr/local/etc/xinetd.conf'
$package_name = 'security/xinetd'
$service_name = 'xinetd'
$confdir = '/usr/local/etc/xinetd.d'
$conffile = '/usr/local/etc/xinetd.conf'
$package_name = 'security/xinetd'
$service_hasrestart = false
$service_hasstatus = true
$service_name = 'xinetd'
}
'Suse': {
$confdir = '/etc/xinetd.d'
$conffile = '/etc/xinetd.conf'
$package_name = 'xinetd'
$service_name = 'xinetd'
$confdir = '/etc/xinetd.d'
$conffile = '/etc/xinetd.conf'
$package_name = 'xinetd'
$service_hasrestart = true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whiniest comment ever but can you :sort these? I know it's picky but it just makes scanning the list easier. 💃

$service_hasstatus = false
$service_name = 'xinetd'
$service_restart = "/sbin/service ${service_name} reload"
}
'RedHat': {
$confdir = '/etc/xinetd.d'
$conffile = '/etc/xinetd.conf'
$package_name = 'xinetd'
$service_name = 'xinetd'
$confdir = '/etc/xinetd.d'
$conffile = '/etc/xinetd.conf'
$package_name = 'xinetd'
$service_hasrestart = true
$service_hasstatus = true
$service_name = 'xinetd'
$service_restart = "/sbin/service ${service_name} reload"
}
'Linux': {
case $::operatingsystem {
Expand Down