Puppet Class: statistics::dataset_mount

Defined in:
modules/statistics/manifests/dataset_mount.pp

Overview

Class statistics::dataset_mount

Mounts /data from dumps/datasets nfs server. xmldumps and other misc files needed for generating statistics are here.

NOTE: This class has nothing to do with the datasets site hosted at 'datasets.wikimedia.org'.

Parameters:

  • dumps_servers (Any)
  • dumps_active_server (Any)


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
# File 'modules/statistics/manifests/dataset_mount.pp', line 9

class statistics::dataset_mount (
      $dumps_servers,
      $dumps_active_server,
  ){
    # need this for NFS mounts.
    require_package('nfs-common')

    file {'/mnt/nfs':
        ensure => 'directory',
    }

    file { '/mnt/nfs/README':
        ensure  => 'present',
        source  => 'puppet:///modules/statistics/dumps-nfsmount-readme.txt',
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        require => File['/mnt/nfs'],
    }

    $dumps_servers.each |String $server| {

        file { "/mnt/nfs/dumps-${server}":
            ensure => 'directory',
        }

        mount { "/mnt/nfs/dumps-${server}":
            ensure  => 'mounted',
            device  => "${server}:/dumps",
            fstype  => 'nfs',
            options => 'ro,bg,tcp,rsize=8192,wsize=8192,timeo=14,intr',
            atboot  => true,
            require => File["/mnt/nfs/dumps-${server}"],
        }
    }

    file { '/mnt/data/':
        ensure  => 'link',
        target  => "/mnt/nfs/dumps-${dumps_active_server}",
        require => Mount["/mnt/nfs/dumps-${dumps_active_server}"],
    }
}