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

Commit

Permalink
Merge pull request #62 from jkroepke/feature/stdlib_fileline
Browse files Browse the repository at this point in the history
Use file_line instead shellvar
  • Loading branch information
dwerder committed Jan 16, 2016
2 parents 91146ca + e3199d3 commit ba021e9
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Gemfile.lock

# idea
./idea
.idea/
*.iml

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

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

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

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

0 comments on commit ba021e9

Please sign in to comment.