Puppet Class: storm::repo

Defined in:
manifests/repo.pp

Summary

Choose which StoRM repository you want to intall and enable. Also a custom list of repository URL can be specified.

Overview

Examples:

Install all the repositories and enable only nightly repo as follow:

class { 'storm::repo':
  enabled => ['stable'],
}

Parameters:

  • installed (Array[Enum['stable', 'beta', 'nightly']]) (defaults to: ['stable', 'beta', 'nightly'])

    The list of repositories that have to be installed. Allowed values are stable, beta and nightly. Optional.

  • enabled (Array[Enum['stable', 'beta', 'nightly']]) (defaults to: ['stable'])

    The list of repositories that have to be enabled. Allowed values are stable, beta and nightly. Optional.

  • extra (Array[Storm::CustomRepo]) (defaults to: [])

    A list of repository that have to be created. Optional.

  • install_umd (Boolean) (defaults to: false)

    Install UMD4 repositories. Default: false.

  • install_epel (Boolean) (defaults to: false)

    Install EPEL repositories. Default: false.



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

class storm::repo (

  Array[Enum['stable', 'beta', 'nightly']] $installed = ['stable', 'beta', 'nightly'],
  Array[Enum['stable', 'beta', 'nightly']] $enabled = ['stable'],

  Array[Storm::CustomRepo] $extra = [],

  Boolean $install_umd = false,
  Boolean $install_epel = false,

) {

  $base = 'https://repo.cloud.cnaf.infn.it/repository'
  $el = $::operatingsystemmajrelease

  $installed.each | $repo | {

    $enabled = $repo in $enabled ? { true => 1, default => 0 }
    $name = "storm-${repo}-centos${el}"
    $baseurl = "${base}/storm-rpm-${repo}/centos${el}/"

    yumrepo { $name:
      ensure   => present,
      descr    => $name,
      baseurl  => $baseurl,
      enabled  => $enabled,
      protect  => 1,
      priority => 1,
      gpgcheck => 0,
    }
  }

  $extra.each | $repo | {

    $name = $repo[name]
    $baseurl = $repo[baseurl]

    yumrepo { $name:
      ensure   => present,
      descr    => $name,
      baseurl  => $baseurl,
      enabled  => 1,
      protect  => 1,
      priority => 1,
      gpgcheck => 0,
    }
  }

  if $install_umd {

    $platform = $::operatingsystemmajrelease
    case $platform {
      '6' : {
        $umd_repo = 'http://repository.egi.eu/sw/production/umd/4/sl6/x86_64/updates/umd-release-4.1.3-1.el6.noarch.rpm'
      }
      '7' : {
        $umd_repo = 'http://repository.egi.eu/sw/production/umd/4/centos7/x86_64/updates/umd-release-4.1.3-1.el7.centos.noarch.rpm'
      }
      default : {
        fail('Unsupported platform for UMD-4')
      }
    }
    package { 'umd-release':
      ensure => installed,
      source => $umd_repo,
    }
  }

  if $install_epel {

    package { 'epel-release':
      ensure => latest,
    }

  }
}