diff --git a/manifests/client.pp b/manifests/client.pp index 935ca31..4b326d3 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,4 +1,4 @@ -# == Class: couchbase::client +# == Type: couchbase::client # # Installs the libcouchbase client library, and the SDK for the desired programming language. # If the language is not specified, it will only install libcouchbase. @@ -8,24 +8,41 @@ # Alex Farcas # define couchbase::client( - $package_ensure = present + $package_ensure = present, + $client_package = $::couchbase::params::client_package, + $development_package = $::couchbase::params::development_package ) { - include ::couchbase::params include ::couchbase::repository - - package { $::couchbase::params::development_package: - ensure => $package_ensure, - require => Class['couchbase::repository'], + + if ! defined(Package[$development_package]) { + package { $development_package: + ensure => $package_ensure, + require => Class['couchbase::repository'], + } } - package { $::couchbase::params::client_package: - ensure => $package_ensure, - require => Package[$::couchbase::params::development_package], + if ! defined(Package[$client_package]) { + package { $client_package: + ensure => $package_ensure, + require => Package[$development_package], + } } case $title { - ruby: { include ::couchbase::client::ruby } - python: { include ::couchbase::client::python } + ruby: { + class { '::couchbase::client::ruby': + package_ensure => $package_ensure, + client_package => $client_package, + development_package => $development_package, + } + } + python: { + class { '::couchbase::client::python': + package_ensure => $package_ensure, + client_package => $client_package, + development_package => $development_package, + } + } default: { } } } diff --git a/manifests/client/python.pp b/manifests/client/python.pp index 0da9b7c..d77fd1e 100644 --- a/manifests/client/python.pp +++ b/manifests/client/python.pp @@ -8,17 +8,17 @@ # Alex Farcas # class couchbase::client::python( - $package_ensure = present -) { - include couchbase::params - + $package_ensure = present, + $client_package = $::couchbase::params::client_package, + $development_package = $::couchbase::params::development_package +) inherits ::couchbase::params { package { 'couchbase_python': ensure => $package_ensure, name => 'couchbase', provider => 'pip', require => [ - Package[$::couchbase::params::client_package], - Package[$::couchbase::params::development_package] + Package[$client_package], + Package[$development_package] ] } } diff --git a/manifests/client/ruby.pp b/manifests/client/ruby.pp index efbe83b..97c75f8 100644 --- a/manifests/client/ruby.pp +++ b/manifests/client/ruby.pp @@ -8,17 +8,17 @@ # Alex Farcas # class couchbase::client::ruby( - $package_ensure = present -) { - include couchbase::params - + $package_ensure = present, + $client_package = $::couchbase::params::client_package, + $development_package = $::couchbase::params::development_package +) inherits ::couchbase::params { package { 'couchbase_ruby': ensure => $package_ensure, name => 'couchbase', provider => 'gem', require => [ - Package[$::couchbase::params::client_package], - Package[$::couchbase::params::development_package] + Package[$client_package], + Package[$development_package] ] } }