Puppet Class: oxidized::install

Defined in:
manifests/install.pp

Summary

Manage oxidized packages

Overview



3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'manifests/install.pp', line 3

class oxidized::install {

  ensure_packages($oxidized::ruby_dependencies)
  $oxidized::ruby_dependencies.each |$package| {
    Package[$package] -> Package['oxidized']
  }
  ensure_packages($oxidized::install_dependencies)
  $oxidized::install_dependencies.each |$package| {
    Package[$package] -> Package['oxidized']
  }

  if $facts.dig('os', 'family') == 'RedHat' {
    if versioncmp($facts['os']['release']['major'], '8') >= 0 {
      $provider = 'system_gem'
    } else {
      $provider = 'scl_gem'
      package { 'cmake': ensure => 'absent' }
      file { '/usr/local/bin/scl_gem':
        ensure => 'file',
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
        source => 'puppet:///modules/oxidized/scl_gem',
        before => Package['oxidized'],
      }
      alternative_entry { '/usr/bin/cmake3':
        ensure   => 'present',
        altlink  => '/usr/bin/cmake',
        altname  => 'cmake',
        priority => 10,
        require  => [
          Package['cmake'],
          Package['cmake3'],
        ],
      }
      alternatives { 'cmake':
        path    => '/usr/bin/cmake3',
        require => Alternative_entry['/usr/bin/cmake3'],
        before  => Package['oxidized'],
      }
    }
  } else {
    $provider = 'system_gem'
  }

  package { 'oxidized':
    ensure   => $oxidized::package_ensure,
    provider => $provider,
  }
  -> package { 'oxidized-script':
    ensure   => $oxidized::script_package_ensure,
    provider => $provider,
  }
  package { 'oxidized-web':
    ensure   => $oxidized::_web_package_ensure,
    provider => $provider,
    require  => Package['oxidized'],
  }
}