Puppet Class: percona::repo

Defined in:
manifests/repo.pp

Overview

Class: percona::repo

percona::repo is to setup repository.

Parameters:

  • ensure (Any) (defaults to: present)
  • percona_release_basearch_enabled (Any) (defaults to: 1)
  • percona_release_noarch_enabled (Any) (defaults to: 1)
  • percona_release_source_enabled (Any) (defaults to: 0)
  • percona_testing_basearch_enabled (Any) (defaults to: 0)
  • percona_testing_noarch_enabled (Any) (defaults to: 0)
  • percona_testing_source_enabled (Any) (defaults to: 0)
  • percona_experimental_basearch_enabled (Any) (defaults to: 0)
  • percona_experimental_noarch_enabled (Any) (defaults to: 0)
  • percona_experimental_source_enabled (Any) (defaults to: 0)


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

class percona::repo (
  $ensure                                = present,

  $percona_release_basearch_enabled      = 1,
  $percona_release_noarch_enabled        = 1,
  $percona_release_source_enabled        = 0,
  $percona_testing_basearch_enabled      = 0,
  $percona_testing_noarch_enabled        = 0,
  $percona_testing_source_enabled        = 0,
  $percona_experimental_basearch_enabled = 0,
  $percona_experimental_noarch_enabled   = 0,
  $percona_experimental_source_enabled   = 0,
) {

  case $::osfamily {
    'RedHat': {
      require percona::rpm_gpg_key

      Yumrepo {
        ensure   => $ensure,
        gpgcheck => 1,
        gpgkey   => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Percona',
      }

      yumrepo {
        'percona-release-$basearch':
          descr   => 'Percona-Release YUM repository - $basearch',
          baseurl => 'http://repo.percona.com/release/$releasever/RPMS/$basearch',
          enabled => $percona_release_basearch_enabled;

        'percona-release-noarch':
          descr   => 'Percona-Release YUM repository - noarch',
          baseurl => 'http://repo.percona.com/release/$releasever/RPMS/noarch',
          enabled => $percona_release_noarch_enabled;

        'percona-release-source':
          descr   => 'Percona-Release YUM repository - Source packages',
          baseurl => 'http://repo.percona.com/release/$releasever/SRPMS',
          enabled => $percona_release_source_enabled;

        'percona-testing-$basearch':
          descr   => 'Percona-Testing YUM repository - $basearch',
          baseurl => 'http://repo.percona.com/testing/$releasever/RPMS/$basearch',
          enabled => $percona_testing_basearch_enabled;

        'percona-testing-noarch':
          descr   => 'Percona-Testing YUM repository - noarch',
          baseurl => 'http://repo.percona.com/testing/$releasever/RPMS/noarch',
          enabled => $percona_testing_noarch_enabled;

        'percona-testing-source':
          descr   => 'Percona-Testing YUM repository - Source packages',
          baseurl => 'http://repo.percona.com/testing/$releasever/SRPMS',
          enabled => $percona_testing_source_enabled;

        'percona-experimental-$basearch':
          descr   => 'Percona-Experimental YUM repository - $basearch',
          baseurl => 'http://repo.percona.com/experimental/$releasever/RPMS/$basearch',
          enabled => $percona_experimental_basearch_enabled;

        'percona-experimental-noarch':
          descr   => 'Percona-Experimental YUM repository - noarch',
          baseurl => 'http://repo.percona.com/experimental/$releasever/RPMS/noarch',
          enabled => $percona_experimental_noarch_enabled;

        'percona-experimental-source':
          descr   => 'Percona-Experimental YUM repository - Source packages',
          baseurl => 'http://repo.percona.com/experimental/$releasever/SRPMS',
          enabled => $percona_experimental_source_enabled;
      }
    }
    'Debian': {
      apt::source { 'percona-release':
        ensure   => $ensure,
        location => 'http://repo.percona.com/apt',
        repos    => 'main',
        key      => {
          id      => '430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A',
          content => file('percona/GPG-key-percona'),
        },
        include  => {
          'src' => true,
          'deb' => true,
        },
      }
    }
    default: {
      fail("Unsupported osfamily: ${::osfamily}")
    }
  }

}