From df8cce3cca0c7a81b44b8fb2f4d85fdd81ad461b Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Jan 2016 18:20:05 +0100 Subject: [PATCH 1/6] Replace shellvar with file_line --- manifests/server/debian.pp | 12 ++++++------ manifests/server/redhat.pp | 12 ++++++------ manifests/server/ubuntu.pp | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/manifests/server/debian.pp b/manifests/server/debian.pp index 22671a0..e39d54e 100644 --- a/manifests/server/debian.pp +++ b/manifests/server/debian.pp @@ -15,15 +15,15 @@ } if ($mountd_port != undef){ - shellvar { 'rpc-mount-options': - ensure => present, - target => '/etc/default/nfs-kernel-server', - variable => 'RPCMOUNTDOPTS', - value => "--manage-gids --port ${mountd_port} --num-threads ${mountd_threads}", + 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'; } if $service_manage { - Shellvar['rpc-mount-options'] ~> Service['nfs-kernel-server'] + File_line['rpc-mount-options'] ~> Service['nfs-kernel-server'] } } diff --git a/manifests/server/redhat.pp b/manifests/server/redhat.pp index 5baae87..a8ece32 100644 --- a/manifests/server/redhat.pp +++ b/manifests/server/redhat.pp @@ -19,15 +19,15 @@ } if ($mountd_port != undef){ - shellvar { 'rpc-mount-options': - ensure => present, - target => '/etc/sysconfig/nfs', - variable => 'MOUNTD_PORT', - value => $mountd_port, + file_line { 'rpc-mount-options': + ensure => present, + path => '/etc/sysconfig/nfs', + line => "MOUNTD_PORT=${mountd_port} --num-threads ${mountd_threads}", + match => '^#?MOUNTD_PORT'; } if $service_manage { - Shellvar['rpc-mount-options'] ~> Service[$service_name] + File_line['rpc-mount-options'] ~> Service[$service_name] } } diff --git a/manifests/server/ubuntu.pp b/manifests/server/ubuntu.pp index 0f52df9..99e31b7 100644 --- a/manifests/server/ubuntu.pp +++ b/manifests/server/ubuntu.pp @@ -15,15 +15,15 @@ } if ($mountd_port != undef){ - shellvar { 'rpc-mount-options': - ensure => present, - target => '/etc/default/nfs-kernel-server', - variable => 'RPCMOUNTDOPTS', - value => "--manage-gids --port ${mountd_port} --num-threads ${mountd_threads}", + file_line { 'rpc-mount-options': + ensure => present, + path => '/etc/default/nfs-kernel-server', + line => "--manage-gids --port ${mountd_port} --num-threads ${mountd_threads}", + match => '^#?RPCMOUNTDOPTS'; } if $service_manage { - Shellvar['rpc-mount-options'] ~> Service['nfs-kernel-server'] + File_line['rpc-mount-options'] ~> Service['nfs-kernel-server'] } } From d4b15f1e389cffd435bb62a68b057937dc720ac2 Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Jan 2016 18:21:05 +0100 Subject: [PATCH 2/6] Remove herculesteam/augeasproviders_shellvar dependency --- metadata.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/metadata.json b/metadata.json index 79841e0..9cba81d 100644 --- a/metadata.json +++ b/metadata.json @@ -68,8 +68,7 @@ "project_page": "https://github.com/echocat/puppet-nfs", "issues_url": "https://github.com/echocat/puppet-nfs/issues", "dependencies": [ - {"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"}, - {"name":"puppetlabs/concat","version_requirement":">= 1.1.1 < 2.0.0"}, - {"name":"herculesteam/augeasproviders_shellvar","version_requirement":">= 2.1.0"} + {"name":"puppetlabs/stdlib","version_requirement":">= 4.8.0 < 5.0.0"}, + {"name":"puppetlabs/concat","version_requirement":">= 1.1.1 < 2.0.0"} ] } From e235d6e52971e44957fe5a6823bd055418723be2 Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Jan 2016 18:31:42 +0100 Subject: [PATCH 3/6] Typo in ubuntu.pp --- .gitignore | 2 ++ manifests/server/ubuntu.pp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5846875..dd61dec 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,8 @@ Gemfile.lock # idea ./idea +.idea/ +*.iml # geppetto/eclipse .project diff --git a/manifests/server/ubuntu.pp b/manifests/server/ubuntu.pp index 99e31b7..aadd841 100644 --- a/manifests/server/ubuntu.pp +++ b/manifests/server/ubuntu.pp @@ -18,7 +18,7 @@ file_line { 'rpc-mount-options': ensure => present, path => '/etc/default/nfs-kernel-server', - line => "--manage-gids --port ${mountd_port} --num-threads ${mountd_threads}", + line => "RPCMOUNTDOPTS=--manage-gids --port ${mountd_port} --num-threads ${mountd_threads}", match => '^#?RPCMOUNTDOPTS'; } From 10dc4780fe39608691598254aa442feed7757add Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Jan 2016 18:33:17 +0100 Subject: [PATCH 4/6] Fix some lint issues. --- manifests/server/debian.pp | 8 ++++---- manifests/server/redhat.pp | 8 ++++---- manifests/server/ubuntu.pp | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifests/server/debian.pp b/manifests/server/debian.pp index e39d54e..019f9d3 100644 --- a/manifests/server/debian.pp +++ b/manifests/server/debian.pp @@ -16,10 +16,10 @@ 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'; } if $service_manage { diff --git a/manifests/server/redhat.pp b/manifests/server/redhat.pp index a8ece32..693ca8d 100644 --- a/manifests/server/redhat.pp +++ b/manifests/server/redhat.pp @@ -20,10 +20,10 @@ if ($mountd_port != undef){ file_line { 'rpc-mount-options': - ensure => present, - path => '/etc/sysconfig/nfs', - line => "MOUNTD_PORT=${mountd_port} --num-threads ${mountd_threads}", - match => '^#?MOUNTD_PORT'; + ensure => present, + path => '/etc/sysconfig/nfs', + line => "MOUNTD_PORT=${mountd_port} --num-threads ${mountd_threads}", + match => '^#?MOUNTD_PORT'; } if $service_manage { diff --git a/manifests/server/ubuntu.pp b/manifests/server/ubuntu.pp index aadd841..698e38b 100644 --- a/manifests/server/ubuntu.pp +++ b/manifests/server/ubuntu.pp @@ -16,10 +16,10 @@ 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'; } if $service_manage { From 87e2e01ee873ff410abcca707dd23b04ec9b517b Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Jan 2016 18:34:58 +0100 Subject: [PATCH 5/6] RedHat C&P fail. --- manifests/server/redhat.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/server/redhat.pp b/manifests/server/redhat.pp index 693ca8d..a5bca31 100644 --- a/manifests/server/redhat.pp +++ b/manifests/server/redhat.pp @@ -22,7 +22,7 @@ file_line { 'rpc-mount-options': ensure => present, path => '/etc/sysconfig/nfs', - line => "MOUNTD_PORT=${mountd_port} --num-threads ${mountd_threads}", + line => "MOUNTD_PORT=${mountd_port}", match => '^#?MOUNTD_PORT'; } From e3199d315867d5ea3bf1491eb83f599b28874748 Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Jan 2016 18:40:54 +0100 Subject: [PATCH 6/6] Fixed rspec tests --- spec/classes/server_debian_spec.rb | 2 +- spec/classes/server_redhat_spec.rb | 2 +- spec/classes/server_ubuntu_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/classes/server_debian_spec.rb b/spec/classes/server_debian_spec.rb index 5208b43..04a8f85 100644 --- a/spec/classes/server_debian_spec.rb +++ b/spec/classes/server_debian_spec.rb @@ -17,7 +17,7 @@ context "mountd params set" do let(:params) {{ :mountd_port => '4711' }} it do - should contain_shellvar('rpc-mount-options') #.with( 'ensure' => 'present' ) + should contain_file_line('rpc-mount-options') #.with( 'ensure' => 'present' ) end end diff --git a/spec/classes/server_redhat_spec.rb b/spec/classes/server_redhat_spec.rb index 81a0da6..f41b119 100644 --- a/spec/classes/server_redhat_spec.rb +++ b/spec/classes/server_redhat_spec.rb @@ -26,7 +26,7 @@ context "mountd params set" do let(:params) {{ :mountd_port => '4711' }} it do - should contain_shellvar('rpc-mount-options') #.with( 'ensure' => 'present' ) + should contain_file_line('rpc-mount-options') #.with( 'ensure' => 'present' ) end end end diff --git a/spec/classes/server_ubuntu_spec.rb b/spec/classes/server_ubuntu_spec.rb index 731e0bd..653bdec 100644 --- a/spec/classes/server_ubuntu_spec.rb +++ b/spec/classes/server_ubuntu_spec.rb @@ -17,7 +17,7 @@ context "mountd params set" do let(:params) {{ :mountd_port => '4711' }} it do - should contain_shellvar('rpc-mount-options') #.with( 'ensure' => 'present' ) + should contain_file_line('rpc-mount-options') #.with( 'ensure' => 'present' ) end end