From 8c2e40a77613f406dcef676b7f119e015d140e61 Mon Sep 17 00:00:00 2001 From: Dionysius Date: Fri, 23 May 2014 15:43:11 +0200 Subject: [PATCH 1/9] workaround bug #3 enable prerequired package definition --- manifests/init.pp | 35 ++++++++++++++++++++++++++++++----- manifests/params.pp | 11 ++++++++--- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 9ef9521..8335f86 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -6,7 +6,8 @@ $enabled_modules = $pbis::params::enabled_modules, $disabled_modules = $pbis::params::disabled_modules, $package = $pbis::params::package, - $package_file = $pbis::params::package_file, + $package_prerequired = $pbis::params::package_prerequired, + $package_file_suffix = $pbis::params::package_file_suffix, $package_file_provider = $pbis::params::package_file_provider, $service_name = $pbis::params::service_name, $assume_default_domain = $pbis::params::assume_default_domain, @@ -32,15 +33,39 @@ elsif $use_repository == false { # Otherwise, download and install the package from the puppetmaster... # a low-performance repo for the poor man - file { "/opt/${package_file}": + + # Compatibilitity switch for pbis <= v7.1.0 + # require also the prerequired package if it is not set to empty string + $require_for_package = File["/opt/${package}.${package_file_suffix}"] + if $package_prerequired == true { + $require_for_package = [ + $require_for_package, + Package[$package_prerequired] + ] + } + + file { "/opt/${package}.${package_file_suffix}": ensure => file, - source => "puppet:///modules/pbis/${package_file}", + source => "puppet:///modules/pbis/${package}.${package_file_suffix}", } package { $package: ensure => installed, - source => "/opt/${package_file}", + source => "/opt/${package}.${package_file_suffix}", provider => $package_file_provider, - require => File["/opt/${package_file}"], + require => $require_for_package_full + } + # install the prerequired package if it is not set to empty string + if $package_prerequired == true { + file { "/opt/${package_prerequired}.${package_file_suffix}": + ensure => file, + source => "puppet:///modules/pbis/${package_prerequired}.${package_file_suffix}", + } + package { $package_prerequired: + ensure => installed, + source => "/opt/${package_prerequired}.${package_file_suffix}", + provider => $package_file_provider, + require => File["/opt/${package_prerequired}.${package_file_suffix}"], + } } } else { diff --git a/manifests/params.pp b/manifests/params.pp index 154a63c..5d9ea7c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,6 +4,11 @@ $use_repository = false $package = 'pbis-open' $service_name = 'lsass' + + # parameter ignored when using repository, but needed when using builtin + # fileserver after pbis v7.1.1 (see bug #3) + # set this to empty string to disable the preinstallation + $package_prerequired = 'pbis-open-upgrade' # domainjoin-cli options $ou = undef @@ -30,9 +35,9 @@ # PBIS Open is packaged for Red Hat, Suse, and Debian derivatives. # When using Puppet's built-in fileserver, choose the .deb or .rpm # automatically. - $package_file = $::osfamily ? { - 'Debian' => "${package}.${::architecture}.deb", - '/(RedHat|Suse)/' => "${package}.${::architecture}.rpm", + $package_file_suffix = $::osfamily ? { + 'Debian' => "${::architecture}.deb", + '/(RedHat|Suse)/' => "${::architecture}.rpm", default => fail("Unsupported operating system: ${::operatingsystem}."), } $package_file_provider = $::osfamily ? { From 28d96dd4e9327cedc7b7f96704cb79ce539240bf Mon Sep 17 00:00:00 2001 From: Dionysius Date: Fri, 23 May 2014 17:15:35 +0200 Subject: [PATCH 2/9] workaround bug #3 fix wrong variable usage --- manifests/init.pp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 8335f86..b3e83db 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -36,12 +36,14 @@ # Compatibilitity switch for pbis <= v7.1.0 # require also the prerequired package if it is not set to empty string - $require_for_package = File["/opt/${package}.${package_file_suffix}"] - if $package_prerequired == true { - $require_for_package = [ - $require_for_package, - Package[$package_prerequired] - ] + if $package_prerequired == "" { + $require_for_package = File["/opt/${package_prerequired}.${package_file_suffix}"] + } + else { + $require_for_package = [ + File["/opt/${package_prerequired}.${package_file_suffix}"], + Package[$package_prerequired] + ] } file { "/opt/${package}.${package_file_suffix}": @@ -52,10 +54,10 @@ ensure => installed, source => "/opt/${package}.${package_file_suffix}", provider => $package_file_provider, - require => $require_for_package_full + require => $require_for_package } # install the prerequired package if it is not set to empty string - if $package_prerequired == true { + unless $package_prerequired == "" { file { "/opt/${package_prerequired}.${package_file_suffix}": ensure => file, source => "puppet:///modules/pbis/${package_prerequired}.${package_file_suffix}", From d5beff52df68bc81479eca31fad57dab2a9f9c20 Mon Sep 17 00:00:00 2001 From: Dionysius Date: Fri, 23 May 2014 17:24:38 +0200 Subject: [PATCH 3/9] Update Readme for example how to use older pbis-open versions --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 36eab9b..eced5e7 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,13 @@ Rename the `pbis-open` package files according to the following convention: pbis-open.amd64.deb pbis-open.i386.deb + pbis-open-upgrade.amd64.deb + pbis-open-upgrade.i386.deb pbis-open.x86_64.rpm pbis-open.i386.rpm + pbis-open-upgrade.x86_64.rpm + pbis-open-upgrade.i386.rpm and place them in the module's `files/` folder. @@ -62,6 +66,17 @@ The service name may not be 'lsass' on newer version of PBIS and may be 'lwsmd'. } } +### Compatibility to PBIS <=v7.1.0 + +PBIS version prior or equal to v7.1.0 do not require the `pbis-open-upgrade` package. Disable it's use by setting: + + node 'workstation' { + class { 'pbis': + ... + package_prerequired => '', + } + } + ## Dependencies This module requires the `osfamily` fact, which depends on Facter 1.6.1+. From d088111274fe45ff1675da134a40c0740e8fe820 Mon Sep 17 00:00:00 2001 From: Dionysius Date: Fri, 23 May 2014 17:34:10 +0200 Subject: [PATCH 4/9] fix wrong filename usage as requirement for core package --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index b3e83db..ee71843 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -37,11 +37,11 @@ # Compatibilitity switch for pbis <= v7.1.0 # require also the prerequired package if it is not set to empty string if $package_prerequired == "" { - $require_for_package = File["/opt/${package_prerequired}.${package_file_suffix}"] + $require_for_package = File["/opt/${package}.${package_file_suffix}"] } else { $require_for_package = [ - File["/opt/${package_prerequired}.${package_file_suffix}"], + File["/opt/${package}.${package_file_suffix}"], Package[$package_prerequired] ] } From 55f15950fbeff8964051e20b3b9d430acb11acc1 Mon Sep 17 00:00:00 2001 From: Dionysius Date: Fri, 23 May 2014 17:54:32 +0200 Subject: [PATCH 5/9] Updated readme with a history entry about removed likewise-open package in the original ubuntu repositories --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index eced5e7..6464dc1 100644 --- a/README.md +++ b/README.md @@ -96,3 +96,5 @@ Please open a pull request with any changes or bugfixes. Likewise Open was acquired by BeyondTrust in 2011 and rebranded as PowerBroker Identity Services Open Edition. The project page is at [powerbrokeropen.org](http://www.powerbrokeropen.org). The original Likewise Open package is included in the Ubuntu repositories, but has not been updated in years. + +In Ubuntu 14.04, the Likewise Open package got removed in the default repositories. More details found in [this bug](https://bugs.launchpad.net/ubuntu/+source/likewise-open/+bug/1295031) From b02b838cb45aa5afaf2793921a9a00d88c381638 Mon Sep 17 00:00:00 2001 From: Dionysius Date: Fri, 23 May 2014 21:32:18 +0200 Subject: [PATCH 6/9] Set installable package to latest so it can be upgraded automatically --- manifests/init.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index ee71843..f296b39 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -27,7 +27,7 @@ if $use_repository == true { # If the package is on an external repo, install it normally. package { $package: - ensure => installed, + ensure => latest, } } elsif $use_repository == false { @@ -51,7 +51,7 @@ source => "puppet:///modules/pbis/${package}.${package_file_suffix}", } package { $package: - ensure => installed, + ensure => latest, source => "/opt/${package}.${package_file_suffix}", provider => $package_file_provider, require => $require_for_package @@ -63,7 +63,7 @@ source => "puppet:///modules/pbis/${package_prerequired}.${package_file_suffix}", } package { $package_prerequired: - ensure => installed, + ensure => latest, source => "/opt/${package_prerequired}.${package_file_suffix}", provider => $package_file_provider, require => File["/opt/${package_prerequired}.${package_file_suffix}"], From 3c97c583fcbfe547ffc317c9a6dead777de9c003 Mon Sep 17 00:00:00 2001 From: dionysius Date: Wed, 4 Jun 2014 21:08:34 +0200 Subject: [PATCH 7/9] fix #6: RedHat based systems are not recognized According to http://docs.puppetlabs.com/puppet/latest/reference/lang_conditional.html regex are not strings. --- manifests/params.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 5d9ea7c..256b709 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -37,12 +37,12 @@ # automatically. $package_file_suffix = $::osfamily ? { 'Debian' => "${::architecture}.deb", - '/(RedHat|Suse)/' => "${::architecture}.rpm", + /(RedHat|Suse)/ => "${::architecture}.rpm", default => fail("Unsupported operating system: ${::operatingsystem}."), } $package_file_provider = $::osfamily ? { 'Debian' => 'dpkg', - '/(RedHat|Suse)/' => 'rpm', + /(RedHat|Suse)/ => 'rpm', default => fail("Unsupported operating system: ${::operatingsystem}."), } } From 461c9ab7456396c507bf45d50e4c6ad5218c77e2 Mon Sep 17 00:00:00 2001 From: dionysius Date: Wed, 4 Jun 2014 21:08:56 +0200 Subject: [PATCH 8/9] Update params.pp --- manifests/params.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 256b709..79cb580 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -37,12 +37,12 @@ # automatically. $package_file_suffix = $::osfamily ? { 'Debian' => "${::architecture}.deb", - /(RedHat|Suse)/ => "${::architecture}.rpm", + /(RedHat|Suse)/ => "${::architecture}.rpm", default => fail("Unsupported operating system: ${::operatingsystem}."), } $package_file_provider = $::osfamily ? { 'Debian' => 'dpkg', - /(RedHat|Suse)/ => 'rpm', + /(RedHat|Suse)/ => 'rpm', default => fail("Unsupported operating system: ${::operatingsystem}."), } } From 2f1c8ec577b6671239eea1ee69d8e9fb35d64326 Mon Sep 17 00:00:00 2001 From: dionysius Date: Fri, 26 Sep 2014 18:34:54 +0200 Subject: [PATCH 9/9] Download Link of pbis-open has changed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6464dc1..591d628 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ This module supports two ways of distributing the PBIS Open packages: The default is to use Puppet's built-in fileserver. -In either case, download the necessary packages from the [BeyondTrust website](http://www.beyondtrust.com/Technical-Support/Downloads/PowerBroker-Identity-Services-Open-Edition/?Pass=True). Extract the architecture-specific `pbis-open` `.rpm` or `.deb` file from the self-extracting `sh` archive. +In either case, download the necessary packages from the [BeyondTrust website](http://download1.beyondtrust.com/Technical-Support/Downloads/PowerBroker-Identity-Services-Open-Edition/?Pass=True). Extract the architecture-specific `pbis-open` `.rpm` or `.deb` file from the self-extracting `sh` archive. ### Using Puppet's built-in fileserver