From 302fdcc41ee3a5d689f43f15d5fd9497584a45c1 Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 29 Mar 2016 16:01:11 +0200 Subject: [PATCH 01/30] fix source entry for forge api --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 7fe1ff5..de94637 100644 --- a/metadata.json +++ b/metadata.json @@ -61,7 +61,7 @@ ], "name": "echocat-nfs", "version": "1.8.1", - "source": "git clone https://github.com/echocat/puppet-nfs.git", + "source": "https://github.com/echocat/puppet-nfs.git", "author": "echocat", "license": "Apache-2.0", "summary": "Installs and configures NFS server and clients", From 083419267ed36428f87c2fb24a44f9d4a7f851ff Mon Sep 17 00:00:00 2001 From: Mathias Merscher Date: Tue, 17 May 2016 16:05:34 +0200 Subject: [PATCH 02/30] allow client mounts to be defined in Hiera Signed-off-by: Mathias Merscher --- manifests/client.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 7a8e3d0..f3ca5f2 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -31,7 +31,8 @@ class nfs::client ( $nfs_v4 = $::nfs::params::nfs_v4, $nfs_v4_mount_root = $::nfs::params::nfs_v4_mount_root, - $nfs_v4_idmap_domain = $::nfs::params::nfs_v4_idmap_domain + $nfs_v4_idmap_domain = $::nfs::params::nfs_v4_idmap_domain, + $mounts = undef ) inherits nfs::params { validate_bool($nfs_v4) @@ -50,4 +51,8 @@ } } + if $mounts { + create_resources(nfs::client::mount, $mounts) + } + } From 9006c9dbaac53524363003b2b18d789806393ba4 Mon Sep 17 00:00:00 2001 From: Mathias Merscher Date: Tue, 17 May 2016 16:13:10 +0200 Subject: [PATCH 03/30] adds README section for nfs::client::mount ENC support Signed-off-by: Mathias Merscher --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 9155a88..0ccde74 100644 --- a/README.md +++ b/README.md @@ -466,6 +466,20 @@ Mount root, where we mount shares, default /srv Domain setting for idmapd, must be the same across server and clients. Default is to use $::domain fact. +#####`mounts` (optional) + +If set, this attribute will be used to construct nfs::client::mount resources. +You can use you ENC or hiera to provide the hash of nfs::client::mount +resources definitions: + +```hiera +nfs::client::mounts: + /mnt/test: + ensure: 'mounted' + server: '192.0.2.100' + share: '/export/data' +``` + #####Example ```puppet From 22ab0e9754a4a5c55b9965275fa227a9185cfff2 Mon Sep 17 00:00:00 2001 From: Peter Wienemann Date: Thu, 19 May 2016 14:46:18 +0200 Subject: [PATCH 04/30] idmapd is only run on NFSv4 Ubuntu clients for versions < 16.04 For details see comment #1 on https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1557015 --- manifests/client/ubuntu/service.pp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/manifests/client/ubuntu/service.pp b/manifests/client/ubuntu/service.pp index bea31c8..072864e 100644 --- a/manifests/client/ubuntu/service.pp +++ b/manifests/client/ubuntu/service.pp @@ -7,10 +7,12 @@ } if $nfs::client::ubuntu::nfs_v4 { - service { 'idmapd': - ensure => running, - enable => true, - subscribe => Augeas['/etc/idmapd.conf', '/etc/default/nfs-common'], + if versioncmp($::lsbdistrelease, '16.04') < 0 { + service { 'idmapd': + ensure => running, + enable => true, + subscribe => Augeas['/etc/idmapd.conf', '/etc/default/nfs-common'], + } } } else { service { 'idmapd': From f933e1e6f8bd27308a9faa78448317271a08c6c2 Mon Sep 17 00:00:00 2001 From: Remi Broemeling Date: Mon, 13 Jun 2016 17:02:44 -0600 Subject: [PATCH 05/30] Require the NFS package to be installed before attempting to modify it (fixes #75). --- manifests/server/debian.pp | 9 +++++---- manifests/server/redhat.pp | 9 +++++---- manifests/server/ubuntu.pp | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/manifests/server/debian.pp b/manifests/server/debian.pp index 103a391..325175e 100644 --- a/manifests/server/debian.pp +++ b/manifests/server/debian.pp @@ -16,10 +16,11 @@ if ($mountd_port != undef){ file_line { 'rpc-mount-options': - ensure => present, - path => '/etc/default/nfs-kernel-server', - line => "RPCMOUNTDOPTS=\"--manage-gids --port ${mountd_port} --num-threads ${mountd_threads}\"", - match => '^#?RPCMOUNTDOPTS'; + ensure => present, + path => '/etc/default/nfs-kernel-server', + line => "RPCMOUNTDOPTS=\"--manage-gids --port ${mountd_port} --num-threads ${mountd_threads}\"", + match => '^#?RPCMOUNTDOPTS', + require => Package['nfs-kernel-server']; } if $service_manage { diff --git a/manifests/server/redhat.pp b/manifests/server/redhat.pp index a5bca31..a74935d 100644 --- a/manifests/server/redhat.pp +++ b/manifests/server/redhat.pp @@ -20,10 +20,11 @@ if ($mountd_port != undef){ file_line { 'rpc-mount-options': - ensure => present, - path => '/etc/sysconfig/nfs', - line => "MOUNTD_PORT=${mountd_port}", - match => '^#?MOUNTD_PORT'; + ensure => present, + path => '/etc/sysconfig/nfs', + line => "MOUNTD_PORT=${mountd_port}", + match => '^#?MOUNTD_PORT', + require => Package['nfs-utils']; } if $service_manage { diff --git a/manifests/server/ubuntu.pp b/manifests/server/ubuntu.pp index 698e38b..f97c796 100644 --- a/manifests/server/ubuntu.pp +++ b/manifests/server/ubuntu.pp @@ -16,10 +16,11 @@ if ($mountd_port != undef){ file_line { 'rpc-mount-options': - ensure => present, - path => '/etc/default/nfs-kernel-server', - line => "RPCMOUNTDOPTS=--manage-gids --port ${mountd_port} --num-threads ${mountd_threads}", - match => '^#?RPCMOUNTDOPTS'; + ensure => present, + path => '/etc/default/nfs-kernel-server', + line => "RPCMOUNTDOPTS=--manage-gids --port ${mountd_port} --num-threads ${mountd_threads}", + match => '^#?RPCMOUNTDOPTS', + require => Package['nfs-kernel-server']; } if $service_manage { From 0488d247ea6bfd6d299dee18a5732a19bf3aa77d Mon Sep 17 00:00:00 2001 From: Cristian Falcas Date: Mon, 26 Sep 2016 15:14:00 +0300 Subject: [PATCH 06/30] allow packages to be updated --- Gemfile | 2 ++ README.md | 8 ++++++++ manifests/client.pp | 5 +++++ manifests/client/debian/install.pp | 4 ++-- manifests/client/gentoo/install.pp | 2 +- manifests/client/mount.pp | 8 ++++---- manifests/client/redhat/install.pp | 6 +++--- manifests/client/ubuntu/install.pp | 4 ++-- manifests/params.pp | 2 ++ manifests/server.pp | 5 +++++ manifests/server/debian/install.pp | 2 +- manifests/server/redhat/install.pp | 2 +- manifests/server/ubuntu/install.pp | 2 +- 13 files changed, 37 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index c3f05b2..5b4482d 100644 --- a/Gemfile +++ b/Gemfile @@ -9,3 +9,5 @@ gem 'facter', facterversion gem 'rspec', '< 3.2.0' # rubi <1.9 versus rake 11.0.0 workaround gem 'rake', '< 11.0.0' +gem 'json', '~> 1.0', {"platforms"=>["ruby_18", "ruby_19"]} +gem 'json_pure', '~> 1.0', {"platforms"=>["ruby_18", "ruby_19"]} diff --git a/README.md b/README.md index 9155a88..fd48366 100644 --- a/README.md +++ b/README.md @@ -340,6 +340,10 @@ Set up NFS server and exports. NFSv3 and NFSv4 supported. Should this class manage the services behind nfs? Set this to false if you are managing the service in another way (e.g. pacemaker). +#####`package_ensure` (installed) + +Allow to update or set to a specific version the nfs server packages. + #####`nfs_v4` (optional) NFSv4 support. Will set up automatic bind mounts to export root. @@ -452,6 +456,10 @@ Set up NFS client and mounts. NFSv3 and NFSv4 supported. **Parameters within `nfs::client`:** +#####`package_ensure` (installed) + +Allow to update or set to a specific version the nfs client packages. + #####`nfs_v4` NFSv4 support. diff --git a/manifests/client.pp b/manifests/client.pp index 7a8e3d0..7b0461c 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -5,6 +5,10 @@ # # === Parameters # +# [package_ensure] +# Allow to update or set to a specific version the nfs client packages +# Default to installed. +# # [nfs_v4] # NFSv4 support. # Disabled by default. @@ -29,6 +33,7 @@ # } class nfs::client ( + $package_ensure = $::nfs::params::client_package_ensure, $nfs_v4 = $::nfs::params::nfs_v4, $nfs_v4_mount_root = $::nfs::params::nfs_v4_mount_root, $nfs_v4_idmap_domain = $::nfs::params::nfs_v4_idmap_domain diff --git a/manifests/client/debian/install.pp b/manifests/client/debian/install.pp index 775db36..16712a8 100644 --- a/manifests/client/debian/install.pp +++ b/manifests/client/debian/install.pp @@ -1,11 +1,11 @@ class nfs::client::debian::install { package { 'rpcbind': - ensure => installed, + ensure => $::nfs::client::package_ensure, } package { ['nfs-common', 'nfs4-acl-tools']: - ensure => installed, + ensure => $::nfs::client::package_ensure, } } diff --git a/manifests/client/gentoo/install.pp b/manifests/client/gentoo/install.pp index ca63d2f..e0432dd 100644 --- a/manifests/client/gentoo/install.pp +++ b/manifests/client/gentoo/install.pp @@ -1,6 +1,6 @@ class nfs::client::gentoo::install { package { ['net-nds/rpcbind', 'net-fs/nfs-utils', 'net-libs/libnfsidmap']: - ensure => installed, + ensure => $::nfs::client::package_ensure, } } diff --git a/manifests/client/mount.pp b/manifests/client/mount.pp index 6bd63a0..e3efced 100644 --- a/manifests/client/mount.pp +++ b/manifests/client/mount.pp @@ -23,10 +23,10 @@ $_nfs4_mount = $mount } - nfs::mkdir{ $_nfs4_mount: - owner => $owner, - group => $group, - perm => $perm; + nfs::mkdir { $_nfs4_mount: + owner => $owner, + group => $group, + perm => $perm; } mount {"shared ${server}:${share} by ${::clientcert} on ${_nfs4_mount}": diff --git a/manifests/client/redhat/install.pp b/manifests/client/redhat/install.pp index 07df9cd..d3d82a6 100644 --- a/manifests/client/redhat/install.pp +++ b/manifests/client/redhat/install.pp @@ -7,16 +7,16 @@ before => Class['nfs::client::redhat::configure'] } package { 'nfs-utils': - ensure => present, + ensure => $::nfs::client::package_ensure, } if $::nfs::client::redhat::params::osmajor == 6 or $::nfs::client::redhat::params::osmajor == 7 { package {'rpcbind': - ensure => present, + ensure => $::nfs::client::package_ensure, } } elsif $::nfs::client::redhat::params::osmajor == 5 { package { 'portmap': - ensure => present, + ensure => $::nfs::client::package_ensure, } } } diff --git a/manifests/client/ubuntu/install.pp b/manifests/client/ubuntu/install.pp index 671db42..90001d1 100644 --- a/manifests/client/ubuntu/install.pp +++ b/manifests/client/ubuntu/install.pp @@ -1,11 +1,11 @@ class nfs::client::ubuntu::install { package { 'rpcbind': - ensure => installed, + ensure => $::nfs::client::package_ensure, } package { ['nfs-common', 'nfs4-acl-tools']: - ensure => installed, + ensure => $::nfs::client::package_ensure, } } diff --git a/manifests/params.pp b/manifests/params.pp index 3a23757..6760bf4 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,4 +1,6 @@ class nfs::params ( + $client_package_ensure = 'installed', + $server_package_ensure = 'installed', $nfs_v4 = false, $nfs_v4_export_root = '/export', $nfs_v4_export_root_clients = "*.${::domain}(ro,fsid=root,insecure,no_subtree_check,async,root_squash)", diff --git a/manifests/server.pp b/manifests/server.pp index 748a12a..b0bbb8a 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -5,6 +5,10 @@ # # === Parameters # +# [package_ensure] +# Allow to update or set to a specific version the nfs server packages +# Default to installed. +# # [nfs_v4] # NFSv4 support. Will set up automatic bind mounts to export root. # Disabled by default. @@ -33,6 +37,7 @@ # } class nfs::server ( + $package_ensure = $::nfs::params::server_package_ensure, $nfs_v4 = $nfs::params::nfs_v4, $nfs_v4_export_root = $nfs::params::nfs_v4_export_root, $nfs_v4_export_root_clients = $nfs::params::nfs_v4_export_root_clients, diff --git a/manifests/server/debian/install.pp b/manifests/server/debian/install.pp index 5fa1c73..5b736f8 100644 --- a/manifests/server/debian/install.pp +++ b/manifests/server/debian/install.pp @@ -1,7 +1,7 @@ class nfs::server::debian::install { package { 'nfs-kernel-server': - ensure => installed + ensure => $::nfs::server::package_ensure } } diff --git a/manifests/server/redhat/install.pp b/manifests/server/redhat/install.pp index 6975836..598749c 100644 --- a/manifests/server/redhat/install.pp +++ b/manifests/server/redhat/install.pp @@ -1,7 +1,7 @@ class nfs::server::redhat::install { package { 'nfs4-acl-tools': - ensure => installed, + ensure => $::nfs::server::package_ensure, } } diff --git a/manifests/server/ubuntu/install.pp b/manifests/server/ubuntu/install.pp index 83a7629..47826bc 100644 --- a/manifests/server/ubuntu/install.pp +++ b/manifests/server/ubuntu/install.pp @@ -1,7 +1,7 @@ class nfs::server::ubuntu::install { package { 'nfs-kernel-server': - ensure => installed + ensure => $::nfs::server::package_ensure } } From cd5b23e6a23eab55c8008a20f6ade8e1d0f31c7d Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Wed, 26 Oct 2016 13:07:08 +0200 Subject: [PATCH 07/30] fix mountd thread number parameter for nfs server. fix #82 --- manifests/server/darwin.pp | 2 +- manifests/server/debian.pp | 2 +- manifests/server/gentoo.pp | 6 +++++- manifests/server/redhat.pp | 42 ++++++++++++++++++++++++++------------ manifests/server/ubuntu.pp | 2 +- 5 files changed, 37 insertions(+), 17 deletions(-) diff --git a/manifests/server/darwin.pp b/manifests/server/darwin.pp index 73fedc5..17981e0 100644 --- a/manifests/server/darwin.pp +++ b/manifests/server/darwin.pp @@ -2,7 +2,7 @@ $nfs_v4 = false, $nfs_v4_idmap_domain = undef, $mountd_port = undef, - $mountd_threads = 1, + $mountd_threads = undef, $service_manage = true, ) { fail('NFS server is not supported on Darwin') diff --git a/manifests/server/debian.pp b/manifests/server/debian.pp index 325175e..1b20586 100644 --- a/manifests/server/debian.pp +++ b/manifests/server/debian.pp @@ -3,7 +3,7 @@ $nfs_v4 = false, $nfs_v4_idmap_domain = undef, $mountd_port = undef, - $mountd_threads = 1, + $mountd_threads = 8, $service_manage = true, ) { diff --git a/manifests/server/gentoo.pp b/manifests/server/gentoo.pp index 2bc46b1..1a6a26f 100644 --- a/manifests/server/gentoo.pp +++ b/manifests/server/gentoo.pp @@ -3,7 +3,7 @@ $nfs_v4 = false, $nfs_v4_idmap_domain = undef, $mountd_port = undef, - $mountd_threads = 1, + $mountd_threads = undef, $service_manage = true, ) { @@ -18,6 +18,10 @@ fail('setting the mountd port currently not supported on Gentoo') } + if ($mountd_threads != undef){ + fail('setting the mountd thread number currently not supported on Gentoo') + } + include nfs::server::gentoo::install, nfs::server::gentoo::service } diff --git a/manifests/server/redhat.pp b/manifests/server/redhat.pp index a74935d..9562191 100644 --- a/manifests/server/redhat.pp +++ b/manifests/server/redhat.pp @@ -1,25 +1,27 @@ -class nfs::server::redhat( +class nfs::server::redhat ( $nfs_v4 = false, $nfs_v4_idmap_domain = undef, $mountd_port = undef, - $mountd_threads = 1, - $service_manage = true, -) { - if $::operatingsystemmajrelease and $::operatingsystemmajrelease =~ /^7/ { - $service_name = 'nfs-server' - } else { - $service_name = 'nfs' - } + $mountd_threads = undef, + $service_manage = true,) { if !defined(Class['nfs::client::redhat']) { - class{ 'nfs::client::redhat': + class { 'nfs::client::redhat': nfs_v4 => $nfs_v4, nfs_v4_idmap_domain => $nfs_v4_idmap_domain, } } - if ($mountd_port != undef){ - file_line { 'rpc-mount-options': + if $::operatingsystemmajrelease and $::operatingsystemmajrelease =~ /^7/ { + $service_name = 'nfs-server' + + } else { + $service_name = 'nfs' + + } + + if ($mountd_port != undef) { + file_line { 'rpc-mount-options-port': ensure => present, path => '/etc/sysconfig/nfs', line => "MOUNTD_PORT=${mountd_port}", @@ -28,7 +30,21 @@ } if $service_manage { - File_line['rpc-mount-options'] ~> Service[$service_name] + File_line['rpc-mount-options-port'] ~> Service[$service_name] + } + } + + if ($mountd_threads != undef) { + file_line { 'rpc-mount-options-threads': + ensure => present, + path => '/etc/sysconfig/nfs', + line => "RPCNFSDCOUNT=${mountd_threads}", + match => '^#?RPCNFSDCOUNT=', + require => Package['nfs-utils']; + } + + if $service_manage { + File_line['rpc-mount-options-threads'] ~> Service[$service_name] } } diff --git a/manifests/server/ubuntu.pp b/manifests/server/ubuntu.pp index f97c796..d222bfc 100644 --- a/manifests/server/ubuntu.pp +++ b/manifests/server/ubuntu.pp @@ -3,7 +3,7 @@ $nfs_v4 = false, $nfs_v4_idmap_domain = undef, $mountd_port = undef, - $mountd_threads = 1, + $mountd_threads = 8, $service_manage = true, ) { From 1af793b48962cc4dc87041969324da2147e7d4c0 Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 11:37:25 +0100 Subject: [PATCH 08/30] Update Rakefile --- Rakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index c35cebb..c49986c 100644 --- a/Rakefile +++ b/Rakefile @@ -9,7 +9,7 @@ PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_class_parameter_defaults') PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_single_quote_string_with_variables') -PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"] desc "Validate manifests, templates, and ruby files in lib." task :validate do @@ -24,4 +24,4 @@ end task :test => [:spec, :lint] -task :default => :test \ No newline at end of file +task :default => :test From 6103f0133657393c7012858c319e4253d55f9648 Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 11:40:30 +0100 Subject: [PATCH 09/30] Update Gemfile --- Gemfile | 52 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index 5b4482d..df38e07 100644 --- a/Gemfile +++ b/Gemfile @@ -1,13 +1,41 @@ -source 'https://rubygems.org' - -puppetversion = ENV.key?('PUPPET_GEM_VERSION') ? "#{ENV['PUPPET_GEM_VERSION']}" : ['>= 3.3'] -facterversion = ENV.key?('FACTER_GEM_VERSION') ? "#{ENV['FACTER_GEM_VERSION']}" : ['>= 1.7'] -gem 'puppet', puppetversion -gem 'puppetlabs_spec_helper', '>= 0.1.0' -gem 'puppet-lint', '>= 0.3.2' -gem 'facter', facterversion -gem 'rspec', '< 3.2.0' +source ENV['GEM_SOURCE'] || "https://rubygems.org" + +def location_for(place, version = nil) + if place =~ /^((?:git|https?)[:@][^#]*)#(.*)/ + [version, { :git => $1, :branch => $2, :require => false }].compact + elsif place =~ /^file:\/\/(.*)/ + ['>= 0', { :path => File.expand_path($1), :require => false }] + else + [place, version, { :require => false }].compact + end +end + +gem 'puppetlabs_spec_helper', '>= 0.1.0', :require => false +gem 'puppet-lint', '>= 0.3.2', :require => false +gem 'rspec-puppet', '>= 2.3.2', :require => false +gem 'rspec-puppet-facts', :require => false +gem 'metadata-json-lint', :require => false # rubi <1.9 versus rake 11.0.0 workaround -gem 'rake', '< 11.0.0' -gem 'json', '~> 1.0', {"platforms"=>["ruby_18", "ruby_19"]} -gem 'json_pure', '~> 1.0', {"platforms"=>["ruby_18", "ruby_19"]} +gem 'rake', '< 11.0.0', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0') +gem 'json', '< 2.0.0', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0') +gem 'json_pure', '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0') + +gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION']) + +# Only explicitly specify Facter/Hiera if a version has been specified. +# Otherwise it can lead to strange bundler behavior. If you are seeing weird +# gem resolution behavior, try setting `DEBUG_RESOLVER` environment variable +# to `1` and then run bundle install. +gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) if ENV['FACTER_GEM_VERSION'] +gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if ENV['HIERA_GEM_VERSION'] + + +# Evaluate Gemfile.local if it exists +if File.exists? "#{__FILE__}.local" + eval(File.read("#{__FILE__}.local"), binding) +end + +# Evaluate ~/.gemfile if it exists +if File.exists?(File.join(Dir.home, '.gemfile')) + eval(File.read(File.join(Dir.home, '.gemfile')), binding) +end From 1b13e9b8bf71cb66bc4d462f6c8fcc4fc00ca745 Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 11:44:17 +0100 Subject: [PATCH 10/30] fix tests for mountd options --- spec/classes/server_redhat_spec.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spec/classes/server_redhat_spec.rb b/spec/classes/server_redhat_spec.rb index f41b119..dc706e3 100644 --- a/spec/classes/server_redhat_spec.rb +++ b/spec/classes/server_redhat_spec.rb @@ -23,10 +23,17 @@ end end - context "mountd params set" do + context "mountd params set port" do let(:params) {{ :mountd_port => '4711' }} it do - should contain_file_line('rpc-mount-options') #.with( 'ensure' => 'present' ) + should contain_file_line('rpc-mount-options-port') #.with( 'ensure' => 'present' ) + end + end + + context "mountd params set threads" do + let(:params) {{ :mountd_threads => '11' }} + it do + should contain_file_line('rpc-mount-options-threads') #.with( 'ensure' => 'present' ) end end end From 83dbebf84cf541da6b826aeb39c0f4644bbe784c Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 11:49:20 +0100 Subject: [PATCH 11/30] set mountd_threads to undef we should keep it to the OS default at default --- manifests/server.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/server.pp b/manifests/server.pp index b0bbb8a..8fdaf4b 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -54,7 +54,7 @@ $nfs_v4_root_export_tag = undef, # $mountd_port = undef, - $mountd_threads = 1, + $mountd_threads = undef, # $exports = undef, ) inherits nfs::params { From c619f5df519d2f0ab9d5b962ada3264947d20f1e Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 11:57:26 +0100 Subject: [PATCH 12/30] drop tests for ruby 1.8.7 --- .travis.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87d702c..36a381a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,22 @@ --- sudo: false language: ruby +cache: bundler bundler_args: --without system_tests -script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'" +before_install: rm Gemfile.lock || true +script: bundle exec rake validate lint spec matrix: fast_finish: true include: - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 3.4.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 3.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 3.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" - - rvm: 2.1.5 - env: PUPPET_GEM_VERSION="~> 3.0" - - rvm: 2.1.5 - env: PUPPET_GEM_VERSION="~> 3.6.0" - - rvm: 2.1.5 - env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" + - rvm: 2.1.6 + env: PUPPET_GEM_VERSION='~> 4.0' COVERAGE=yes STRICT_VARIABLES=yes + - rvm: 2.1.6 + env: PUPPET_GEM_VERSION='https://github.com/puppetlabs/puppet.git#stable + - rvm: 2.1.5 + env: PUPPET_GEM_VERSION='~> 3.0' FUTURE_PARSER=yes + - rvm: 2.1.5 + env: PUPPET_GEM_VERSION='~> 3.0' + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION='~> 3.0' notifications: email: false From 12ef9e72cfcb64029000ca082619dc4d34b5e8df Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 12:04:18 +0100 Subject: [PATCH 13/30] include nfs::client::debian --- spec/classes/client_debian_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index bcfa3a2..352b135 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,6 +1,10 @@ require 'spec_helper' describe 'nfs::client::debian' do + let :pre_condition do + 'include ::nfs::client::debian' + end + it do should contain_class('nfs::client::debian::install') should contain_class('nfs::client::debian::configure') From 73c561eebdde0d091ca06473942ab5296992d65a Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 12:08:51 +0100 Subject: [PATCH 14/30] Update client_debian_spec.rb --- spec/classes/client_debian_spec.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index 352b135..8c94a6f 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,8 +1,10 @@ require 'spec_helper' describe 'nfs::client::debian' do - - let :pre_condition do - 'include ::nfs::client::debian' + let(:facts) do + :osfamily => 'RedHat' + end + let :pre_condition do + 'include ::nfs::client' end it do From 205a97fcd57f16175496287b86a9ca49b2a8d69c Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 12:29:13 +0100 Subject: [PATCH 15/30] Update client_debian_spec.rb --- spec/classes/client_debian_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index 8c94a6f..7a3a7bd 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' describe 'nfs::client::debian' do - let(:facts) do - :osfamily => 'RedHat' + let(:facts) {{ :osfamily => 'RedHat' }} end let :pre_condition do 'include ::nfs::client' From 5f1fe3ece3d2c7b6eedef4daacc69eec5ddf311d Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 12:33:04 +0100 Subject: [PATCH 16/30] Update client_debian_spec.rb --- spec/classes/client_debian_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index 7a3a7bd..43a2c5c 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' describe 'nfs::client::debian' do let(:facts) {{ :osfamily => 'RedHat' }} - end let :pre_condition do 'include ::nfs::client' end From 5ecd195343b56d1a4509cad59078ba459f823da6 Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 12:36:41 +0100 Subject: [PATCH 17/30] Update client_debian_spec.rb --- spec/classes/client_debian_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index 43a2c5c..6920062 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' describe 'nfs::client::debian' do - let(:facts) {{ :osfamily => 'RedHat' }} + let(:facts) {{ :osfamily => 'Debian', :operatingsystem => 'Debian' }} let :pre_condition do 'include ::nfs::client' end From 7e0f6f7020faaafd21ebd97a53c7c8b6bd19cfd5 Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 13:20:40 +0100 Subject: [PATCH 18/30] revert changes --- spec/classes/client_debian_spec.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index 6920062..bcfa3a2 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,10 +1,6 @@ require 'spec_helper' describe 'nfs::client::debian' do - let(:facts) {{ :osfamily => 'Debian', :operatingsystem => 'Debian' }} - let :pre_condition do - 'include ::nfs::client' - end - + it do should contain_class('nfs::client::debian::install') should contain_class('nfs::client::debian::configure') From 1875417cefcffc6d8d2b4b823695d89a50123fb9 Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 13:22:58 +0100 Subject: [PATCH 19/30] fix mountd test --- spec/classes/server_debian_spec.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/spec/classes/server_debian_spec.rb b/spec/classes/server_debian_spec.rb index 04a8f85..c3d8d89 100644 --- a/spec/classes/server_debian_spec.rb +++ b/spec/classes/server_debian_spec.rb @@ -12,14 +12,21 @@ it do should contain_service('idmapd').with( 'ensure' => 'running' ) end - end - context "mountd params set" do + + context "mountd params set port" do let(:params) {{ :mountd_port => '4711' }} it do - should contain_file_line('rpc-mount-options') #.with( 'ensure' => 'present' ) + should contain_file_line('rpc-mount-options-port') #.with( 'ensure' => 'present' ) end + end + context "mountd params set threads" do + let(:params) {{ :mountd_threads => '11' }} + it do + should contain_file_line('rpc-mount-options-threads') #.with( 'ensure' => 'present' ) + end end + end From 78adf80c714af69155fd8cec6a749defa2720d98 Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 13:32:32 +0100 Subject: [PATCH 20/30] fix mountd test --- spec/classes/server_ubuntu_spec.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spec/classes/server_ubuntu_spec.rb b/spec/classes/server_ubuntu_spec.rb index 653bdec..84b3478 100644 --- a/spec/classes/server_ubuntu_spec.rb +++ b/spec/classes/server_ubuntu_spec.rb @@ -13,13 +13,18 @@ should contain_service('idmapd').with( 'ensure' => 'running' ) end - end - context "mountd params set" do + context "mountd params set port" do let(:params) {{ :mountd_port => '4711' }} it do - should contain_file_line('rpc-mount-options') #.with( 'ensure' => 'present' ) + should contain_file_line('rpc-mount-options-port') #.with( 'ensure' => 'present' ) end + end + context "mountd params set threads" do + let(:params) {{ :mountd_threads => '11' }} + it do + should contain_file_line('rpc-mount-options-threads') #.with( 'ensure' => 'present' ) + end end -end +end From 3825f91e7d1d1bb556cc320f86b7a59e044cd15c Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Tue, 15 Nov 2016 13:39:18 +0100 Subject: [PATCH 21/30] Update server_ubuntu_spec.rb --- spec/classes/server_ubuntu_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/classes/server_ubuntu_spec.rb b/spec/classes/server_ubuntu_spec.rb index 84b3478..b064623 100644 --- a/spec/classes/server_ubuntu_spec.rb +++ b/spec/classes/server_ubuntu_spec.rb @@ -12,6 +12,7 @@ it do should contain_service('idmapd').with( 'ensure' => 'running' ) end + end context "mountd params set port" do let(:params) {{ :mountd_port => '4711' }} From 72f96eacbea5289e2a0569ecd6dccfd09bb7480a Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Sat, 17 Dec 2016 09:55:43 +0100 Subject: [PATCH 22/30] allow puppetlabs-concat 2.x --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index de94637..5e0d064 100644 --- a/metadata.json +++ b/metadata.json @@ -69,6 +69,6 @@ "issues_url": "https://github.com/echocat/puppet-nfs/issues", "dependencies": [ {"name":"puppetlabs/stdlib","version_requirement":">= 4.8.0 < 5.0.0"}, - {"name":"puppetlabs/concat","version_requirement":">= 1.1.1 < 2.0.0"} + {"name":"puppetlabs/concat","version_requirement":">= 1.1.1 < 3.0.0"} ] } From 505eba6d19c38931adc14250f8e30e1eb411596e Mon Sep 17 00:00:00 2001 From: "daniel.werdermann" Date: Thu, 26 Jan 2017 10:06:37 +0100 Subject: [PATCH 23/30] prepare release 1.9.0 --- CHANGELOG.md | 12 ++++++++++++ metadata.json | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d840d8..a374c68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 2017-01-26 - 1.9.0 (Feature release) + +#### Bugfixes: + +- fix mountd thread number parameter for nfs server + +#### Features: + +- set specific version of nfs client packages with `package_ensure` +- allow client mounts to be defined in Hiera +- Ubuntu: support 16.04 + ## 2016-03-19 - 1.8.1 (Bugfix release) #### Bugfixes: diff --git a/metadata.json b/metadata.json index 5e0d064..dbec2d4 100644 --- a/metadata.json +++ b/metadata.json @@ -37,7 +37,8 @@ "operatingsystemrelease": [ "10.04", "12.04", - "14.04" + "14.04", + "16.04" ] }, { @@ -60,7 +61,7 @@ } ], "name": "echocat-nfs", - "version": "1.8.1", + "version": "1.9.0", "source": "https://github.com/echocat/puppet-nfs.git", "author": "echocat", "license": "Apache-2.0", From 5dbef987ea29711a1d48516d53a99cbe9b48afc7 Mon Sep 17 00:00:00 2001 From: "daniel.werdermann" Date: Thu, 26 Jan 2017 10:21:26 +0100 Subject: [PATCH 24/30] fix some rspec tests --- spec/classes/client_debian_spec.rb | 2 ++ spec/classes/client_gentoo_spec.rb | 2 ++ spec/classes/client_redhat_spec.rb | 3 +++ spec/classes/client_ubuntu_spec.rb | 2 ++ 4 files changed, 9 insertions(+) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index bcfa3a2..650387c 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe 'nfs::client::debian' do + let(:params) {{ :package_ensure = installed }} + it do should contain_class('nfs::client::debian::install') should contain_class('nfs::client::debian::configure') diff --git a/spec/classes/client_gentoo_spec.rb b/spec/classes/client_gentoo_spec.rb index e397118..e366404 100644 --- a/spec/classes/client_gentoo_spec.rb +++ b/spec/classes/client_gentoo_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe 'nfs::client::gentoo' do + let(:params) {{ :package_ensure = installed }} + it do should contain_class('nfs::client::gentoo') should contain_class('nfs::client::gentoo::install') diff --git a/spec/classes/client_redhat_spec.rb b/spec/classes/client_redhat_spec.rb index 23418b3..d98c0db 100644 --- a/spec/classes/client_redhat_spec.rb +++ b/spec/classes/client_redhat_spec.rb @@ -1,5 +1,8 @@ require 'spec_helper' describe 'nfs::client::redhat' do + + let(:params) {{ :package_ensure = installed }} + context "operatingsystemrelease => 7.0" do let(:facts) { {:operatingsystemrelease => '7.0' } } it do diff --git a/spec/classes/client_ubuntu_spec.rb b/spec/classes/client_ubuntu_spec.rb index 0140614..c887838 100644 --- a/spec/classes/client_ubuntu_spec.rb +++ b/spec/classes/client_ubuntu_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe 'nfs::client::ubuntu' do + let(:params) {{ :package_ensure = installed }} + it do should contain_class('nfs::client::ubuntu::install') should contain_class('nfs::client::ubuntu::configure') From de14775a21b2df1e35658a7d31344b06abce58c8 Mon Sep 17 00:00:00 2001 From: "daniel.werdermann" Date: Thu, 26 Jan 2017 10:24:22 +0100 Subject: [PATCH 25/30] fix rspec --- spec/classes/client_debian_spec.rb | 2 +- spec/classes/client_gentoo_spec.rb | 2 +- spec/classes/client_redhat_spec.rb | 2 +- spec/classes/client_ubuntu_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index 650387c..6f395bc 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'nfs::client::debian' do - let(:params) {{ :package_ensure = installed }} + let(:params) {{ :package_ensure => installed }} it do should contain_class('nfs::client::debian::install') diff --git a/spec/classes/client_gentoo_spec.rb b/spec/classes/client_gentoo_spec.rb index e366404..6bc7e80 100644 --- a/spec/classes/client_gentoo_spec.rb +++ b/spec/classes/client_gentoo_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'nfs::client::gentoo' do - let(:params) {{ :package_ensure = installed }} + let(:params) {{ :package_ensure => installed }} it do should contain_class('nfs::client::gentoo') diff --git a/spec/classes/client_redhat_spec.rb b/spec/classes/client_redhat_spec.rb index d98c0db..7eea7a0 100644 --- a/spec/classes/client_redhat_spec.rb +++ b/spec/classes/client_redhat_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'nfs::client::redhat' do - let(:params) {{ :package_ensure = installed }} + let(:params) {{ :package_ensure => installed }} context "operatingsystemrelease => 7.0" do let(:facts) { {:operatingsystemrelease => '7.0' } } diff --git a/spec/classes/client_ubuntu_spec.rb b/spec/classes/client_ubuntu_spec.rb index c887838..bdb1729 100644 --- a/spec/classes/client_ubuntu_spec.rb +++ b/spec/classes/client_ubuntu_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'nfs::client::ubuntu' do - let(:params) {{ :package_ensure = installed }} + let(:params) {{ :package_ensure => installed }} it do should contain_class('nfs::client::ubuntu::install') From 66226089fda69d0c526025d4bed06eb86e6399ad Mon Sep 17 00:00:00 2001 From: "daniel.werdermann" Date: Thu, 26 Jan 2017 10:32:22 +0100 Subject: [PATCH 26/30] fix rspec --- spec/classes/client_debian_spec.rb | 2 +- spec/classes/client_gentoo_spec.rb | 2 +- spec/classes/client_redhat_spec.rb | 2 +- spec/classes/client_ubuntu_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index 6f395bc..d7bbea5 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'nfs::client::debian' do - let(:params) {{ :package_ensure => installed }} + let(:params) {{ :package_ensure => 'installed' }} it do should contain_class('nfs::client::debian::install') diff --git a/spec/classes/client_gentoo_spec.rb b/spec/classes/client_gentoo_spec.rb index 6bc7e80..1084241 100644 --- a/spec/classes/client_gentoo_spec.rb +++ b/spec/classes/client_gentoo_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'nfs::client::gentoo' do - let(:params) {{ :package_ensure => installed }} + let(:params) {{ :package_ensure => 'installed' }} it do should contain_class('nfs::client::gentoo') diff --git a/spec/classes/client_redhat_spec.rb b/spec/classes/client_redhat_spec.rb index 7eea7a0..e0740ce 100644 --- a/spec/classes/client_redhat_spec.rb +++ b/spec/classes/client_redhat_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'nfs::client::redhat' do - let(:params) {{ :package_ensure => installed }} + let(:params) {{ :package_ensure => 'installed' }} context "operatingsystemrelease => 7.0" do let(:facts) { {:operatingsystemrelease => '7.0' } } diff --git a/spec/classes/client_ubuntu_spec.rb b/spec/classes/client_ubuntu_spec.rb index bdb1729..d782a9c 100644 --- a/spec/classes/client_ubuntu_spec.rb +++ b/spec/classes/client_ubuntu_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'nfs::client::ubuntu' do - let(:params) {{ :package_ensure => installed }} + let(:params) {{ :package_ensure => 'installed' }} it do should contain_class('nfs::client::ubuntu::install') From 53ef89e60f7ded28d852a3c9fff50e964f33f8fd Mon Sep 17 00:00:00 2001 From: "daniel.werdermann" Date: Thu, 26 Jan 2017 10:46:49 +0100 Subject: [PATCH 27/30] fix rspec --- spec/classes/client_debian_spec.rb | 7 ++++++- spec/classes/server_debian_spec.rb | 9 +-------- spec/classes/server_ubuntu_spec.rb | 9 +-------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index d7bbea5..63a1fa4 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -1,7 +1,12 @@ require 'spec_helper' describe 'nfs::client::debian' do - let(:params) {{ :package_ensure => 'installed' }} + let(:facts) do + facts + end + let :pre_condition do + 'include ::params' + end it do should contain_class('nfs::client::debian::install') diff --git a/spec/classes/server_debian_spec.rb b/spec/classes/server_debian_spec.rb index c3d8d89..81a15ba 100644 --- a/spec/classes/server_debian_spec.rb +++ b/spec/classes/server_debian_spec.rb @@ -17,14 +17,7 @@ context "mountd params set port" do let(:params) {{ :mountd_port => '4711' }} it do - should contain_file_line('rpc-mount-options-port') #.with( 'ensure' => 'present' ) - end - end - - context "mountd params set threads" do - let(:params) {{ :mountd_threads => '11' }} - it do - should contain_file_line('rpc-mount-options-threads') #.with( 'ensure' => 'present' ) + should contain_file_line('rpc-mount-options') #.with( 'ensure' => 'present' ) end end diff --git a/spec/classes/server_ubuntu_spec.rb b/spec/classes/server_ubuntu_spec.rb index b064623..aaa1b84 100644 --- a/spec/classes/server_ubuntu_spec.rb +++ b/spec/classes/server_ubuntu_spec.rb @@ -17,14 +17,7 @@ context "mountd params set port" do let(:params) {{ :mountd_port => '4711' }} it do - should contain_file_line('rpc-mount-options-port') #.with( 'ensure' => 'present' ) - end - end - - context "mountd params set threads" do - let(:params) {{ :mountd_threads => '11' }} - it do - should contain_file_line('rpc-mount-options-threads') #.with( 'ensure' => 'present' ) + should contain_file_line('rpc-mount-options') #.with( 'ensure' => 'present' ) end end From bd7d70c80b89c03d2a6f69e90983c9e3fd374ae7 Mon Sep 17 00:00:00 2001 From: "daniel.werdermann" Date: Thu, 26 Jan 2017 12:40:41 +0100 Subject: [PATCH 28/30] fix rspec --- spec/classes/client_debian_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/client_debian_spec.rb b/spec/classes/client_debian_spec.rb index 63a1fa4..1c82e86 100644 --- a/spec/classes/client_debian_spec.rb +++ b/spec/classes/client_debian_spec.rb @@ -5,7 +5,7 @@ facts end let :pre_condition do - 'include ::params' + 'include ::nfs::client' end it do From 57c736353cda67f50e83f9a689c5cf2d2aad397c Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Wed, 3 May 2017 06:00:01 +0200 Subject: [PATCH 29/30] fix markdown for github --- README.md | 124 ++++++++++++++++++++++++------------------------------ 1 file changed, 56 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index f163925..d03f225 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -#nfs +# nfs -####Table of Contents +#### Table of Contents 1. [Overview - What is the nfs module?](#overview) 2. [Module Description - What does this module do?](#module-description) @@ -20,7 +20,7 @@ 6. [Limitations - OS compatibility, etc.](#limitations) 7. [Contributing to the graphite module](#contributing) -##Overview +## Overview This module installs, configures and manages everything on NFS clients and servers. @@ -28,19 +28,19 @@ This module installs, configures and manages everything on NFS clients and serve [![Build Status](https://secure.travis-ci.org/echocat/puppet-nfs.png?branch=master)](https://travis-ci.org/echocat/puppet-nfs) [![Puppet Forge Downloads](http://img.shields.io/puppetforge/dt/echocat/nfs.svg)](https://forge.puppetlabs.com/echocat/nfs) -##Module Description +## Module Description This module can be used to simply mount nfs shares on a client or to configure your nfs servers. It can make use of storeconfigs on the puppetmaster to get its resources. -##Setup +## Setup **What nfs affects:** * packages/services/configuration files for NFS usage * can be used with puppet storage -###Simple mount nfs share +### Simple mount nfs share This example mounts a nfs share on the client, with NFSv3 @@ -54,7 +54,7 @@ include '::nfs::client' } ``` -###NFSv3 server and client +### NFSv3 server and client This will export /data/folder on the server and automagically mount it on client. You need storeconfigs/puppetdb for this to work. @@ -80,7 +80,7 @@ node client { } ``` -###NFSv3 multiple exports, servers and multiple node +### NFSv3 multiple exports, servers and multiple node ```puppet node server1 { @@ -148,7 +148,7 @@ node client { } ``` -###NFSv4 Simple example +### NFSv4 Simple example We use the `$::domain` fact for the Domain setting in `/etc/idmapd.conf`. For NFSv4 to work this has to be equal on servers and clients @@ -217,7 +217,7 @@ node client2 { } ``` -###NFSv4 insanely overcomplicated reference +### NFSv4 insanely overcomplicated reference Just to show you, how complex we can make things ;-) @@ -327,38 +327,38 @@ nfs::server::export {'/data': You can also give options to each host in a hash, and then use the stdlib keys() function to extract the client array from the hash: `mk_client_list(keys($client_hash), $client_hash, '')` -##Usage +## Usage -####Class: `nfs::server` +#### Class: `nfs::server` Set up NFS server and exports. NFSv3 and NFSv4 supported. **Parameters within `nfs::server`:** -#####`service_manage` (true) +##### `service_manage` (true) Should this class manage the services behind nfs? Set this to false if you are managing the service in another way (e.g. pacemaker). -#####`package_ensure` (installed) +##### `package_ensure` (installed) Allow to update or set to a specific version the nfs server packages. -#####`nfs_v4` (optional) +##### `nfs_v4` (optional) NFSv4 support. Will set up automatic bind mounts to export root. Disabled by default. -#####`nfs_v4_export_root` (optional) +##### `nfs_v4_export_root` (optional) Export root, where we bind mount shares, default /export -#####`nfs_v4_idmap_domain` (optional) +##### `nfs_v4_idmap_domain` (optional) Domain setting for idmapd, must be the same across server and clients. Default is to use $domain fact. -#####`exports` (optional) +##### `exports` (optional) If set, this attribute will be used to construct nfs::server::export resources. You can use you ENC or hiera to @@ -371,7 +371,7 @@ nfs::server::exports: clients: '*(fsid=0,ro,insecure,async,all_squash,no_subtree_check,mountpoint=/mnt/something)' ``` -#####Examples +##### Examples ```puppet class { '::nfs::server': @@ -383,65 +383,66 @@ class { '::nfs::server': } ``` -####Defined Type: `nfs::server::export` +#### Defined Type: `nfs::server::export` Set up NFS export on the server (and stores data in configstore) **Parameters within `nfs::server::export`:** -#####`v3_export_name` (optional) +##### `v3_export_name` (optional) Default is `$name`. Usally you do not set it explicit. -#####`v4_export_name` (optional) +##### `v4_export_name` (optional) Default results from `$name`. Usally you do not set it explicit. -#####`ensure` (optional) +##### `ensure` (optional) Default is 'mounted' -#####`bind` (optional) +##### `bind` (optional) Default is 'rbind'. rbind or bind mounting of folders bindmounted into /export. Google it! **Following parameteres are propogated by to storeconfigs to clients** -#####`mount` (optional) +##### `mount` (optional) Default is undef. This means client mount path is the same as server export path. Directory where we want export mounted on client -#####`remounts` (optional) +##### `remounts` (optional) Default is false. -#####`atboot` (optional) +##### `atboot` (optional) Default is false. -#####`options` (optional) +##### `options` (optional) Default is '_netdev'. Don't remove that option, but feel free to add more. -#####`bindmount` (optional) +##### `bindmount` (optional) Default is undef. If set will mount share inside /srv (or overridden mount_root) and then bindmount to another directory elsewhere in the fs - for fanatics. -#####`nfstag` (optional) +##### `nfstag` (optional) Default is undef. Used to identify a catalog item for filtering by storeconfigs on clients. -#####`clients` (optional) +##### `clients` (optional) Default is 'localhost(ro)'. Copied directly into /etc/exports as a string, for simplicity. -#####`server` (optional) +##### `server` (optional) Default is `$::clientcert`. Used to specify a other ip/name for the client to connect to. Usefull in machines with multiple ip addresses or network interfaces -#####Example + +##### Example ```puppet ::nfs::server::export { '/media_library': @@ -450,31 +451,31 @@ Default is `$::clientcert`. Used to specify a other ip/name for the client to co } ``` -####Class: `nfs::client` +#### Class: `nfs::client` Set up NFS client and mounts. NFSv3 and NFSv4 supported. **Parameters within `nfs::client`:** -#####`package_ensure` (installed) +##### `package_ensure` (installed) Allow to update or set to a specific version the nfs client packages. -#####`nfs_v4` +##### `nfs_v4` NFSv4 support. Disabled by default. -#####`nfs_v4_mount_root` +##### `nfs_v4_mount_root` Mount root, where we mount shares, default /srv -#####`nfs_v4_idmap_domain` +##### `nfs_v4_idmap_domain` Domain setting for idmapd, must be the same across server and clients. Default is to use $::domain fact. -#####`mounts` (optional) +##### `mounts` (optional) If set, this attribute will be used to construct nfs::client::mount resources. You can use you ENC or hiera to provide the hash of nfs::client::mount @@ -488,7 +489,7 @@ nfs::client::mounts: share: '/export/data' ``` -#####Example +##### Example ```puppet class { '::nfs::client': @@ -499,79 +500,66 @@ class { '::nfs::client': } ``` -####Defined Type: `nfs::client::mount` +#### Defined Type: `nfs::client::mount` Set up NFS mount on client. **Parameters within `nfs::client::mount`:** -#####`server` +##### `server` FQDN or IP of the NFS server. -#####`share` +##### `share` Name of share to be mounted. -#####`ensure` (optional) +##### `ensure` (optional) Default is 'mounted'. -#####`mount` (optional) +##### `mount` (optional) Default is `$title` of defined type. Defines mountpoint of the share on the client. -#####`remounts` (optional) +##### `remounts` (optional) Default is false. -#####`atboot` (optional) +##### `atboot` (optional) Default is false. -#####`options` (optional) +##### `options` (optional) Default is '_netdev'. Don't remove that option, but feel free to add more. -#####`bindmount` (optional) +##### `bindmount` (optional) Default is undef. If set will mount share inside /srv (or overridden mount_root) and then bindmount to another directory elsewhere in the fs - for fanatics. -#####`nfstag` (optional) +##### `nfstag` (optional) Default is undef. Used to identify a catalog item for filtering by storeconfigs on clients. -#####`owner` (optional) +##### `owner` (optional) Default is 'root'. Sets owner of mountpoint directory. This is applied to the directory on every run, which means it is used both on the base mountpoint creation when unmounted, and also once mounted on the target NFS server and thus all servers accessing the same share. - -#####`group` (optional) +##### `group` (optional) Default is `root`. Sets group of mountpoint directory. This is applied to the directory on every run, which means it is used both on the base mountpoint creation when unmounted, and also once mounted on the target NFS server and thus all servers accessing the same share. - -#####`perm` (optional) +##### `perm` (optional) Default is '0755'. Sets mode of mountpoint directory. This has changed from previous versons which used '0777' (world writable). This is applied to the directory on every run, which means it is used both on the base mountpoint creation when unmounted, and also once mounted on the target NFS server and thus all servers accessing the same share. - -##Requirements +## Requirements If you want to have the full potential of this module its recommend to have storeconfigs enabled. -###Modules needed: - -* stdlib by puppetlabs -* concat by puppetlabs - -###Software versions needed: - -* facter > 1.6.2 -* puppet > 2.6.2 - -##Limitations +## Limitations ##Contributing From cd8b952821e74891c5a9d092d897c551eb9b4278 Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Wed, 3 May 2017 06:00:54 +0200 Subject: [PATCH 30/30] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d03f225..0b1368a 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ 2. [Module Description - What does this module do?](#module-description) 3. [Setup - The basics of getting started with nfs](#setup) * [Simple mount an nfs share](#simple-mount-nfs-share) - * [NFSv3 server and client] (#nfsv3-server-and-client) - * [NFSv3 multiple exports, servers and multiple node] (#nfsv3-multiple-exports-servers-and-multiple-node) - * [NFSv4 Simple example] (#nfsv4-simple-example) - * [NFSv4 insanely overcomplicated reference] (#nfsv4-insanely-overcomplicated-reference) - * [A large number of clients] (#a-large-number-of-clients) + * [NFSv3 server and client](#nfsv3-server-and-client) + * [NFSv3 multiple exports, servers and multiple node](#nfsv3-multiple-exports-servers-and-multiple-node) + * [NFSv4 Simple example](#nfsv4-simple-example) + * [NFSv4 insanely overcomplicated reference](#nfsv4-insanely-overcomplicated-reference) + * [A large number of clients](#a-large-number-of-clients) 4. [Usage - The classes and defined types available for configuration](#usage) * [Class: nfs::server](#class-nfsserver) * [Defined Type: nfs::server::export](#defined-type-nfsserverexport)