Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a parameter that allow to precise package ensure #382

Merged
merged 2 commits into from
Sep 28, 2013
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ Setting this to false will avoid the user resource to be created by this module.

Setting this to false will avoid the group resource to be created by this module. This is useful when you already have a group created in another puppet module and that you want to used it for apache. Without this, it would result in a duplicate resource error.

#####`package_ensure`

Allow control over the package ensure statement. This is useful if you want to make sure apache is always at the latest version or wheter it is only installed.

####Class: `apache::default_mods`

Expand Down
3 changes: 2 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@
$ports_file = $apache::params::ports_file,
$server_tokens = 'OS',
$server_signature = 'On',
$package_ensure = 'installed',
) inherits apache::params {

package { 'httpd':
ensure => installed,
ensure => $package_ensure,
name => $apache::params::apache_name,
notify => Class['Apache::Service'],
}
Expand Down
6 changes: 4 additions & 2 deletions spec/classes/apache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
end
it { should include_class("apache::params") }
it { should contain_package("httpd").with(
'notify' => 'Class[Apache::Service]'
'notify' => 'Class[Apache::Service]',
'ensure' => 'installed'
)
}
it { should contain_user("www-data") }
Expand Down Expand Up @@ -133,7 +134,8 @@
end
it { should include_class("apache::params") }
it { should contain_package("httpd").with(
'notify' => 'Class[Apache::Service]'
'notify' => 'Class[Apache::Service]',
'ensure' => 'installed'
)
}
it { should contain_user("apache") }
Expand Down