Puppet Class: mrepo::exports

Defined in:
manifests/exports.pp

Overview

This class configures NFS exporting of mrepo repository data.

Examples

class { ‘mrepo::exports’:

clients => '10.10.0.0/24',

}

Author

Adrien Thebo <adrien@puppetlabs.com>

Copyright 2012 Puppet Labs, unless otherwise noted

Parameters:

  • clients (Any)


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/exports.pp', line 17

class mrepo::exports ($clients) {
  $file_path = '/usr/local/sbin/export-mrepo'

  file { $file_path:
    ensure => file,
    source => 'puppet:///modules/mrepo/export-mrepo',
    owner  => '0',
    group  => '0',
    mode   => '0755',
  }

  if is_array($clients) {
    $clients_real = inline_template('<%= scope.lookupvar("clients").map {|c| "-c #{c}"}.join(" ") %>')
  }
  else {
    $clients_real = "-c ${clients}"
  }

  cron { 'Export mrepo repositories':
    ensure  => present,
    command => "${file_path} ${clients_real} write",
    user    => 'root',
    minute  => fqdn_rand(60),
    require => File[$file_path],
  }
}