aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom De Vylder <tom@penumbra.be>2012-11-27 17:19:07 +0100
committerTom De Vylder <tom@penumbra.be>2012-11-27 17:19:07 +0100
commitb9686e0c2edfe299e3aa351060da9e42ede1b5bd (patch)
tree77af154c2e73facf22c52d7eb6794f881ce0fc3c
parentdd1e1fd538890e2f76baeeb26fed56f329fbd670 (diff)
downloadpuppet-nfs-b9686e0c2edfe299e3aa351060da9e42ede1b5bd.tar.gz
puppet-nfs-b9686e0c2edfe299e3aa351060da9e42ede1b5bd.tar.bz2
Bugfix: NFS daemon failed to start on RHEL/CentOS
-rw-r--r--README.md1
-rw-r--r--manifests/install.pp36
-rw-r--r--manifests/params.pp2
-rw-r--r--manifests/service.pp31
4 files changed, 36 insertions, 34 deletions
diff --git a/README.md b/README.md
index d5bc5bb..f4cf655 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@
* Debian 5 (Lenny)
* Debian 6 (Squeeze)
+* CentOS 6
## Example usage
diff --git a/manifests/install.pp b/manifests/install.pp
index c7665ba..c9e9e56 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -2,37 +2,17 @@
#
class nfs::install {
- case $::osfamily {
- 'RedHat': {
- # Both client and server are installed using
- # a single package on RHEL
-
- if $::nfs::client or $::nfs::server {
- package { $::nfs::pkg_list_client:
- ensure => $::nfs::pkg_ensure;
- }
- }
- }
-
- 'Debian': {
- # On Debian client and server packages are split.
-
- if $::nfs::client {
- package { $::nfs::pkg_list_client:
- ensure => $::nfs::pkg_ensure;
- }
- }
-
- if $::nfs::server {
- package { $::nfs::pkg_list_server:
- ensure => $::nfs::pkg_ensure;
- }
- }
+ if $::nfs::client {
+ package { $::nfs::pkg_list_client:
+ ensure => $::nfs::pkg_ensure;
}
+ }
- default: {
- fail "Operating system ${::operatingsystem} is not supported yet."
+ if $::nfs::server {
+ package { $::nfs::pkg_list_server:
+ ensure => $::nfs::pkg_ensure;
}
}
+
}
diff --git a/manifests/params.pp b/manifests/params.pp
index ea48a87..db46c24 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -14,7 +14,7 @@ class nfs::params {
$config_user = 'root'
$pkg_ensure = present
$pkg_list_client = 'nfs-utils'
- $pkg_list_server = 'nfs-utils'
+ $pkg_list_server = 'rpcbind'
$service_enable = true
$service_ensure = running
$service_hasrestart = true
diff --git a/manifests/service.pp b/manifests/service.pp
index 952f90d..e012fe6 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -2,11 +2,32 @@
#
class nfs::service {
if $::nfs::server {
- service { $::nfs::service_name:
- ensure => $::nfs::service_ensure,
- enable => $::nfs::service_enable,
- hasstatus => $::nfs::service_hasstatus,
- require => Class['::nfs::config'];
+
+ if $::osfamily == 'RedHat' {
+
+ service { 'rpcbind':
+ ensure => $::nfs::service_ensure,
+ enable => $::nfs::service_enable,
+ hasstatus => $::nfs::service_hasstatus,
+ require => Class['::nfs::config'];
+ }
+
+ service { $::nfs::service_name:
+ ensure => $::nfs::service_ensure,
+ enable => $::nfs::service_enable,
+ hasstatus => $::nfs::service_hasstatus,
+ require => [ Class['::nfs::config'], Service['rpcbind'], ];
+ }
+
+ } else {
+
+ service { $::nfs::service_name:
+ ensure => $::nfs::service_ensure,
+ enable => $::nfs::service_enable,
+ hasstatus => $::nfs::service_hasstatus,
+ require => Class['::nfs::config'];
+ }
+
}
}
}