Sha256: 987d71a81e02c63f32315212d4db5ed26fdeac3e6fd9e021521d9366bbd76ce7

Contents?: true

Size: 1.8 KB

Versions: 14

Compression:

Stored size: 1.8 KB

Contents

# PRIVATE CLASS: do not call directly
class postgresql::server::install {
  $package_ensure      = $postgresql::server::package_ensure
  $package_name        = $postgresql::server::package_name
  $client_package_name = $postgresql::server::client_package_name

  # This is necessary to ensure that the extra client package that was
  # installed automatically by the server package is removed and all
  # of its dependencies are removed also. Without this later installation
  # of the native Ubuntu packages will fail.
  if($::operatingsystem == 'Ubuntu' and $package_ensure == 'absent') {
    # This is an exec, because we want to invoke autoremove.
    #
    # An alternative would be to have a full list of packages, but that seemed
    # more problematic to maintain, not to mention the conflict with the
    # client class will create duplicate resources.
    exec { 'apt-get-autoremove-postgresql-client-XX':
      command   => "apt-get autoremove --purge --yes ${client_package_name}",
      onlyif    => "dpkg -l ${client_package_name} | grep -e '^ii'",
      logoutput => on_failure,
      path      => '/usr/bin:/bin:/usr/sbin/:/sbin',
    }

    # This will clean up anything we miss
    exec { 'apt-get-autoremove-postgresql-client-brute':
      command   => "dpkg -P postgresql*",
      onlyif    => "dpkg -l postgresql* | grep -e '^ii'",
      logoutput => on_failure,
      path      => '/usr/bin:/bin:/usr/sbin/:/sbin',
    }
  }

  $_package_ensure = $package_ensure ? {
    true     => 'present',
    false    => 'purged',
    'absent' => 'purged',
    default => $package_ensure,
  }

  package { 'postgresql-server':
    ensure => $_package_ensure,
    name   => $package_name,

    # This is searched for to create relationships with the package repos, be
    # careful about its removal
    tag    => 'postgresql',
  }

}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/postgresql/manifests/server/install.pp
freighthop-0.6.0 modules/postgresql/manifests/server/install.pp
freighthop-0.5.2 modules/postgresql/manifests/server/install.pp
freighthop-0.5.1 modules/postgresql/manifests/server/install.pp
freighthop-0.5.0 modules/postgresql/manifests/server/install.pp
freighthop-0.4.1 modules/postgresql/manifests/server/install.pp
freighthop-0.4.0 modules/postgresql/manifests/server/install.pp
freighthop-0.3.3 modules/postgresql/manifests/server/install.pp
freighthop-0.3.2 modules/postgresql/manifests/server/install.pp
freighthop-0.3.1 modules/postgresql/manifests/server/install.pp
freighthop-0.3.0 modules/postgresql/manifests/server/install.pp
freighthop-0.2.1 modules/postgresql/manifests/server/install.pp
freighthop-0.2.0 modules/postgresql/manifests/server/install.pp
freighthop-0.1.0 modules/postgresql/manifests/server/install.pp