Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Use file_line instead shellvar #62

Merged
merged 7 commits into from
Jan 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -42,6 +42,8 @@ Gemfile.lock

# idea
./idea
.idea/
*.iml

# geppetto/eclipse
.project
12 changes: 6 additions & 6 deletions manifests/server/debian.pp
Original file line number Diff line number Diff line change
@@ -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']
}
}

12 changes: 6 additions & 6 deletions manifests/server/redhat.pp
Original file line number Diff line number Diff line change
@@ -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}",
match => '^#?MOUNTD_PORT';
}

if $service_manage {
Shellvar['rpc-mount-options'] ~> Service[$service_name]
File_line['rpc-mount-options'] ~> Service[$service_name]
}
}

12 changes: 6 additions & 6 deletions manifests/server/ubuntu.pp
Original file line number Diff line number Diff line change
@@ -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']
}
}

5 changes: 2 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -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"}
]
}
2 changes: 1 addition & 1 deletion spec/classes/server_debian_spec.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion spec/classes/server_redhat_spec.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion spec/classes/server_ubuntu_spec.rb
Original file line number Diff line number Diff line change
@@ -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