Puppet Class: st2::repo

Inherits:
st2
Defined in:
manifests/repo.pp

Summary

Manages the installation of st2 required repos for installing the StackStorm packages.

Overview

Examples:

Basic usage

include st2::repo

Installing from unstable

class { 'st2::repo':
  repository => 'unstable',
}

Parameters:

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

    The basic state the repo should be in

  • repository (St2::Repository) (defaults to: $st2::repository)

    Release repository to enable

  • manage_epel_repo (Boolean) (defaults to: true)


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

class st2::repo (
  Enum['present', 'absent'] $ensure = 'present',
  St2::Repository $repository = $st2::repository,
  Boolean $manage_epel_repo = true,
) inherits st2 {
  case $facts['os']['family'] {
    'RedHat': {
      # RedHat distros need EPEL, $manage_epel_repo can be set to false if not needed
      if $manage_epel_repo {
        require epel
      }

      $dist_version = $facts['os']['release']['major']
      $baseurl = "https://packagecloud.io/StackStorm/${repository}/el/${dist_version}/\$basearch"
      $gpgkey = "https://packagecloud.io/StackStorm/${repository}/gpgkey"

      contain st2::repo::yum
    }

    'Debian': {
      # debian, ubuntu, etc
      $osname = downcase($facts['os']['name'])
      # trusty, xenial, bionic, etc
      $release = downcase($facts['os']['distro']['codename'])
      $location = "https://packagecloud.io/StackStorm/${repository}/${osname}"
      $repos = 'main'

      $key_id = $repository ? {
        'stable'           => '3CE01873543A4CCE',
        'staging-stable'   => '527B93CA96ADF311',
        'staging-unstable' => '9A2236A8CEC0C6A8',
        'unstable'         => '1CDF3CE710B2CCF3',
        default            => '3CE01873543A4CCE', # stable
      }
      $key_source = "https://packagecloud.io/StackStorm/${repository}/gpgkey"

      contain st2::repo::apt
    }

    default: {
      fail("Unsupported managed repository for osfamily: ${facts['os']['family']}, operatingsystem: ${facts['os']['name']}")
    }
  }
}