Puppet Class: kapacitor::repo

Defined in:
manifests/repo.pp

Summary

Manages gpg key information and repository, if necessary

Overview

Examples:

include kapacitor::repo

Parameters:

  • manage_repo (Boolean) (defaults to: $kapacitor::manage_repo)
  • repo_location (Stdlib::HTTPSUrl) (defaults to: $kapacitor::repo_location)
  • repo_type (String) (defaults to: $kapacitor::repo_type)


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

class kapacitor::repo (
  Boolean $manage_repo = $kapacitor::manage_repo,
  Stdlib::HTTPSUrl $repo_location = $kapacitor::repo_location,
  String $repo_type = $kapacitor::repo_type,
){

  case $facts['os']['family'] {
    'Debian': {
      if $manage_repo {
        apt::source { 'influxdata':
          comment  => 'InfluxData repository',
          location => "${repo_location}${facts['os']['name'].downcase}",
          release  => $facts['os']['distro']['codename'],
          repos    => $repo_type,
          key      => {
            'id'     => '05CE15085FC09D18E99EFB22684A14CF2582E0C5',
            'source' => "${repo_location}influxdb.key",
          },
        }
      }
    }

    'RedHat': {
      if $manage_repo {
        yumrepo { 'influxdata':
          descr    => 'InfluxData Repository',
          enabled  => 1,
          baseurl  => "${repo_location}rhel/${facts['os']['release']['major']}/${facts['os']['architecture']}/${repo_type}",
          gpgkey   => "${repo_location}influxdb.key",
          gpgcheck => 1,
        }
      }
    }
    default: {
      fail("This os ${facts['os']['family']} is not supported")
    }
  }
}