Puppet Class: profile::wmcs::nfs::standalone

Defined in:
modules/profile/manifests/wmcs/nfs/standalone.pp

Overview

Class: profile::wmcs::nfs::standalone

Sets up an Openstack instance-based NFS server

Parameters:

  • cinder_attached (Boolean) (defaults to: lookup('profile::wcms::nfs::standalone::cinder_attached'))
  • volumes (Array[String]) (defaults to: lookup('profile::wcms::nfs::standalone::volumes'))


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
# File 'modules/profile/manifests/wmcs/nfs/standalone.pp', line 5

class profile::wmcs::nfs::standalone(
    Boolean $cinder_attached = lookup('profile::wcms::nfs::standalone::cinder_attached'),
    Array[String] $volumes   = lookup('profile::wcms::nfs::standalone::volumes'),
) {
    require profile::openstack::eqiad1::observerenv

    class {'cloudnfs': }

    $nfs_service_name = "${volumes[0]}.svc.${::labsproject}.${::wmcs_deployment}.wikimedia.cloud"

    if ($cinder_attached) {
        $nfs_service_ip = ipresolve($nfs_service_name, 4)

        interface::ip { 'nfs-service-ip':
            ensure    => present,
            address   => $nfs_service_ip,
            interface => $facts['interface_primary'],
        }
    }

    sysctl::parameters { 'cloudstore base':
        values   => {
            # Increase TCP max buffer size
            'net.core.rmem_max' => 67108864,
            'net.core.wmem_max' => 67108864,

            # Increase Linux auto-tuning TCP buffer limits
            # Values represent min, default, & max num. of bytes to use.
            'net.ipv4.tcp_rmem' => [ 4096, 87380, 33554432 ],
            'net.ipv4.tcp_wmem' => [ 4096, 65536, 33554432 ],
        },
        priority => 70,
    }

    class {'cloudnfs::fileserver::exports':
        server_vols     => $volumes,
        cinder_attached => $cinder_attached,
    }

    # state manually managed
    service { 'nfs-server':
        enable => false,
    }

    file {'/usr/local/sbin/logcleanup':
        source => 'puppet:///modules/cloudnfs/logcleanup.py',
        mode   => '0744',
        owner  => 'root',
        group  => 'root',
    }

    file {'/etc/logcleanup-config.yaml':
        source => 'puppet:///modules/profile/wmcs/nfs/primary/logcleanup-config.yaml',
        mode   => '0644',
        owner  => 'root',
        group  => 'root',
    }
}