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 pbis-open-upgrade package compatibility with legacy support #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ 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

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.

Expand Down Expand Up @@ -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+.
Expand All @@ -81,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)
41 changes: 34 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -26,21 +27,47 @@
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 {
# 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
if $package_prerequired == "" {
$require_for_package = File["/opt/${package}.${package_file_suffix}"]
}
else {
$require_for_package = [
File["/opt/${package}.${package_file_suffix}"],
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}",
ensure => latest,
source => "/opt/${package}.${package_file_suffix}",
provider => $package_file_provider,
require => File["/opt/${package_file}"],
require => $require_for_package
}
# install the prerequired package if it is not set to empty string
unless $package_prerequired == "" {
file { "/opt/${package_prerequired}.${package_file_suffix}":
ensure => file,
source => "puppet:///modules/pbis/${package_prerequired}.${package_file_suffix}",
}
package { $package_prerequired:
ensure => latest,
source => "/opt/${package_prerequired}.${package_file_suffix}",
provider => $package_file_provider,
require => File["/opt/${package_prerequired}.${package_file_suffix}"],
}
}
}
else {
Expand Down
13 changes: 9 additions & 4 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,14 +35,14 @@
# 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 ? {
'Debian' => 'dpkg',
'/(RedHat|Suse)/' => 'rpm',
/(RedHat|Suse)/ => 'rpm',
default => fail("Unsupported operating system: ${::operatingsystem}."),
}
}