Skip to content

Commit

Permalink
make package 'ensure' variable, with 'present' as default
Browse files Browse the repository at this point in the history
  • Loading branch information
CyBeRoni committed Mar 2, 2014
1 parent 121e5c4 commit 3547fdc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion manifests/client.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class ssh::client(
$options = {}
$options = {},
$ensure = present,
) inherits ssh::params {
$merged_options = merge($ssh::params::ssh_default_options, $options)

Expand Down
6 changes: 4 additions & 2 deletions manifests/client/install.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
class ssh::client::install {
class ssh::client::install (
$ensure = present
) {
if !defined(Package[$ssh::params::client_package_name]) {
package { $ssh::params::client_package_name:
ensure => present,
ensure => $ensure,
}
}
}
3 changes: 2 additions & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class ssh::server(
$options = {}
$options = {},
$ensure = present
) inherits ssh::params {
$merged_options = merge($ssh::params::sshd_default_options, $options)

Expand Down
6 changes: 4 additions & 2 deletions manifests/server/install.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
class ssh::server::install {
class ssh::server::install (
$ensure = present
) {
include ssh::params
if !defined(Package[$ssh::params::server_package_name]) {
package { $ssh::params::server_package_name:
ensure => present,
ensure => $ensure,
}
}
}

0 comments on commit 3547fdc

Please sign in to comment.