Puppet Class: foreman::repo

Defined in:
manifests/repo.pp

Overview

Configure the foreman repo

Parameters:

  • repo (Optional[Variant[Enum['nightly'], Pattern['^\d+\.\d+$']]]) (defaults to: undef)

    The repository version to manage. This can be a specific version or nightly

  • configure_scl_repo (Boolean) (defaults to: $facts['os']['name'] == 'CentOS' and $facts['os']['release']['major'] == '7')

    If disabled the SCL repo will not be configured on Red Hat clone systems. (Currently only installs repos for CentOS and Scientific)

  • gpgcheck (Boolean) (defaults to: true)

    Turn on/off gpg check in repo files (effective only on RedHat family systems)

  • scl_repo_ensure (String) (defaults to: 'installed')

    The ensure to set on the SCL repo package

  • yum_repo_baseurl (Stdlib::HTTPUrl) (defaults to: 'https://yum.theforeman.org')

    The base URL for Yum repositories



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
# File 'manifests/repo.pp', line 18

class foreman::repo(
  Optional[Variant[Enum['nightly'], Pattern['^\d+\.\d+$']]] $repo = undef,
  Boolean $gpgcheck = true,
  Boolean $configure_scl_repo = $facts['os']['name'] == 'CentOS' and $facts['os']['release']['major'] == '7',
  String $scl_repo_ensure = 'installed',
  Stdlib::HTTPUrl $yum_repo_baseurl = 'https://yum.theforeman.org',
) {
  if $repo {
    foreman::repos { 'foreman':
      repo             => $repo,
      gpgcheck         => $gpgcheck,
      yum_repo_baseurl => $yum_repo_baseurl,
      before           => Anchor['foreman::repo'],
    }

    if $configure_scl_repo {
      Foreman::Repos['foreman'] -> Package['centos-release-scl-rh']
    }

    if $facts['os']['release']['major'] == '8' and ($repo == 'nightly' or versioncmp($repo, '3.2') >= 0) {
      package { 'foreman':
        ensure      => "el${facts['os']['release']['major']}",
        enable_only => true,
        provider    => 'dnfmodule',
        require     => Foreman::Repos['foreman'],
      }
    } elsif $facts['os']['release']['major'] == '8' and versioncmp($repo, '2.5') >= 0 {
      package { 'ruby':
        ensure      => '2.7',
        enable_only => true,
        provider    => 'dnfmodule',
      }
    }
  }

  if $configure_scl_repo {
    package {'centos-release-scl-rh':
      ensure => $scl_repo_ensure,
      before => Anchor['foreman::repo'],
    }
  }

  # An anchor is used because it can be collected
  anchor { 'foreman::repo': } # lint:ignore:anchor_resource
}