Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Commit

Permalink
new format for setting os/version specific params
Browse files Browse the repository at this point in the history
  • Loading branch information
koglinjg committed May 12, 2015
1 parent 892b49b commit af2ba09
Showing 1 changed file with 44 additions and 73 deletions.
117 changes: 44 additions & 73 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,79 +17,50 @@
### Application related parameters

$mode = 'server'

$package = $::operatingsystem ? {
/(?i:Debian|Ubuntu|Mint)/ => 'nfs-common',
default => 'nfs-utils',
}

$package_server = $::operatingsystem ? {
/(?i:Debian|Ubuntu|Mint)/ => 'nfs-kernel-server',
default => ''
}

$service = $::operatingsystem ? {
/(?i:Debian|Ubuntu|Mint)/ => 'nfs-kernel-server',
/(?i:RedHat|Centos|Scientific)/ => 'nfs-server',
default => 'nfs',
}

$service_status = $::operatingsystem ? {
default => true,
}

$process = $::operatingsystem ? {
/(?i:RedHat|Centos|Scientific)/ => 'nfsd',
default => 'nfs',
}

$process_args = $::operatingsystem ? {
default => '',
}

$process_user = $::operatingsystem ? {
default => 'root',
}

$config_dir = $::operatingsystem ? {
default => '',
}

$config_file = $::operatingsystem ? {
default => '/etc/exports',
}

$config_file_mode = $::operatingsystem ? {
default => '0644',
}

$config_file_owner = $::operatingsystem ? {
default => 'root',
}

$config_file_group = $::operatingsystem ? {
default => 'root',
}

$config_file_init = $::operatingsystem ? {
/(?i:Debian|Ubuntu|Mint)/ => '/etc/default/nfs',
default => '/etc/sysconfig/nfs',
}

$pid_file = $::operatingsystem ? {
default => '/var/run/nfs.pid',
}

$data_dir = $::operatingsystem ? {
default => '/etc/nfs',
}

$log_dir = $::operatingsystem ? {
default => '/var/log/nfs',
}

$log_file = $::operatingsystem ? {
default => '/var/log/nfs/nfs.log',
$service_status = true
$process_args = ''
$process_user = 'root'
$config_dir = ''
$config_file = '/etc/exports'
$config_file_mode = '0644'
$config_file_owner = 'root'
$config_file_group = 'root'
$pid_file = '/var/run/nfs.pid'
$data_dir = '/etc/nfs'
$log_dir = '/var/log/nfs'
$log_file = '/var/log/nfs/nfs.log'


case $::osfamily {
'Debian', 'Ubuntu', 'Mint': {
$package = 'nfs-common'
$package_server = 'nfs-kernel-server'
$service = 'nfs-kernel-server'
$process = 'nfs'
$config_file_init = '/etc/default/nfs'
}
'RedHat': {
case $::operatingsystem {
'RedHat', 'CentOS', 'OracleLinux', 'Scientific': {
if (versioncmp($::operatingsystemrelease, '7.0') < 0) { # less than 7.0
$package = 'nfs-utils'
$package_server = ''
$service = 'nfs'
$process = 'nfsd'
$config_file_init = '/etc/sysconfig/nfs'
}
else { #7.0+
$package = 'nfs-utils'
$package_server = ''
$service = 'nfs-server'
$process = 'nfsd'
$config_file_init = '/etc/sysconfig/nfs'
}
}
default: { fail("unsupported os ${::operatingsystem}") }
}
}
default: { fail("unsupported os ${::operatingsystem}") }
}

$port = '2049'
Expand Down

0 comments on commit af2ba09

Please sign in to comment.