Puppet Class: openondemand::repo::rpm

Defined in:
manifests/repo/rpm.pp

Summary

Manage Open OnDemand RPM repos

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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'manifests/repo/rpm.pp', line 3

class openondemand::repo::rpm {
  assert_private()

  if $openondemand::repo_nightly {
    exec { 'makecache ondemand-web-nightly':
      path        => '/usr/bin:/bin:/usr/sbin:/sbin',
      command     => "${facts['package_provider']} -q makecache -y --disablerepo='*' --enablerepo='ondemand-web-nightly'",
      refreshonly => true,
      subscribe   => Yumrepo['ondemand-web-nightly'],
    }
  }

  yumrepo { 'ondemand-web':
    descr           => 'Open OnDemand Web Repo',
    baseurl         => $openondemand::repo_baseurl,
    enabled         => '1',
    gpgcheck        => '1',
    repo_gpgcheck   => '1',
    gpgkey          => $openondemand::repo_gpgkey,
    metadata_expire => '1',
    priority        => $openondemand::repo_priority,
    exclude         => $openondemand::repo_exclude,
    proxy           => $openondemand::repo_proxy,
  }

  yumrepo { 'ondemand-web-nightly':
    ensure          => $openondemand::nightly_ensure,
    descr           => 'Open OnDemand Web Repo - Nightly',
    baseurl         => $openondemand::repo_nightly_baseurl,
    enabled         => '1',
    gpgcheck        => '1',
    repo_gpgcheck   => '1',
    gpgkey          => $openondemand::repo_gpgkey,
    metadata_expire => '1',
    priority        => $openondemand::repo_priority,
    proxy           => $openondemand::repo_proxy,
  }

  # Work around a bug where 'dnf module list' is not executed with -y
  if versioncmp($openondemand::osmajor, '8') == 0 {
    exec { 'dnf makecache ondemand-web':
      path        => '/usr/bin:/bin:/usr/sbin:/sbin',
      command     => "dnf -q makecache -y --disablerepo='*' --enablerepo='ondemand-web'",
      refreshonly => true,
      subscribe   => Yumrepo['ondemand-web'],
    }
    if $openondemand::manage_dependency_repos {
      Exec['dnf makecache ondemand-web'] -> Package['nodejs']
      Exec['dnf makecache ondemand-web'] -> Package['ruby']
    }
  }

  if $openondemand::manage_epel {
    contain epel
  }

  if versioncmp($openondemand::osmajor, '7') <= 0 and $openondemand::manage_dependency_repos {
    if $facts['os']['name'] == 'CentOS' and versioncmp($openondemand::osmajor, '7') == 0 {
      file { '/etc/yum.repos.d/ondemand-centos-scl.repo':
        ensure => 'absent',
      }
    }

    case $facts['os']['name'] {
      'RedHat': {
        rh_repo { "rhel-server-rhscl-${openondemand::osmajor}-rpms":
          ensure => 'present',
        }
      }
      'CentOS': {
        package { 'centos-release-scl':
          ensure => 'installed',
        }
      }
      default: {
        # Do nothing
      }
    }
  }

  if versioncmp($openondemand::osmajor, '8') == 0 and $openondemand::manage_dependency_repos {
    package { 'nodejs':
      ensure      => '14',
      enable_only => true,
      provider    => 'dnfmodule',
    }
    package { 'ruby':
      ensure      => '3.0',
      enable_only => true,
      provider    => 'dnfmodule',
    }
  }
}