Defined Type: scl::collection

Defined in:
manifests/collection.pp

Overview

Software Collection install helper.

Examples:

Install a collection and permanently enable it

::scl::collection { 'rh-git29':
  enable => true,
}

Parameters:

  • collection (String) (defaults to: $title)

    The name of the collection, which is itself a metapackage to install.

  • enable (Boolean) (defaults to: false)

    Drop a fragment in /etc/profile.d to permanently enable the collection.

  • ensure (Enum['present', 'absent']) (defaults to: 'present')

See Also:

Since:

  • 1.0.0



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'manifests/collection.pp', line 17

define scl::collection (
  String                    $collection = $title,
  Boolean                   $enable     = false,
  Enum['present', 'absent'] $ensure     = 'present',
) {

  if ! defined(Class['::scl']) {
    fail('You must include the scl base class before using any scl defined resources')
  }

  package { $collection:
    ensure => $ensure,
  }

  if $ensure == 'present' and $enable {
    file { "/etc/profile.d/scl-${collection}.sh":
      ensure  => file,
      owner   => 0,
      group   => 0,
      mode    => '0644',
      content => @("EOS"/L),
        source scl_source enable ${collection}
        | EOS
      require => Package[$collection],
    }
  } else {
    file { "/etc/profile.d/scl-${collection}.sh":
      ensure => absent,
    }
  }
}