Skip to content

Commit

Permalink
ensure json_package is installed via ensure_packages
Browse files Browse the repository at this point in the history
This commit changes the installation of rubygem-json from an explicit
package definition to ensure_packages. This may prevent a duplicate
declaration of the package resource.
  • Loading branch information
timogoebel committed Jan 27, 2016
1 parent 08911c3 commit 9cb3201
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions manifests/puppetmaster.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
default: { $json_package = 'rubygem-json' }
}

package { $json_package:
ensure => installed,
}
ensure_packages([$json_package])

file {"${puppet_etcdir}/foreman.yaml":
content => template("${module_name}/puppet.yaml.erb"),
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/foreman_puppetmaster_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
end

it 'should install json package' do
should contain_package(json_package).with_ensure('installed')
should contain_package(json_package).with_ensure('present')
end

it 'should create puppet.yaml' do
Expand Down Expand Up @@ -140,7 +140,7 @@
end

it 'should install json package' do
should contain_package('rubygem-json').with_ensure('installed')
should contain_package('rubygem-json').with_ensure('present')
end
end
end
Expand Down

0 comments on commit 9cb3201

Please sign in to comment.