diff options
author | Tom De Vylder <tom@penumbra.be> | 2012-11-27 17:19:07 +0100 |
---|---|---|
committer | Tom De Vylder <tom@penumbra.be> | 2012-11-27 17:19:07 +0100 |
commit | b9686e0c2edfe299e3aa351060da9e42ede1b5bd (patch) | |
tree | 77af154c2e73facf22c52d7eb6794f881ce0fc3c | |
parent | dd1e1fd538890e2f76baeeb26fed56f329fbd670 (diff) | |
download | puppet-nfs-b9686e0c2edfe299e3aa351060da9e42ede1b5bd.tar.gz puppet-nfs-b9686e0c2edfe299e3aa351060da9e42ede1b5bd.tar.bz2 |
Bugfix: NFS daemon failed to start on RHEL/CentOS
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | manifests/install.pp | 36 | ||||
-rw-r--r-- | manifests/params.pp | 2 | ||||
-rw-r--r-- | manifests/service.pp | 31 |
4 files changed, 36 insertions, 34 deletions
@@ -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']; + } + } } } |