Defined Type: cloudnfs::volume_config

Defined in:
modules/cloudnfs/manifests/volume_config.pp

Summary

creates a nfs-mounts.yaml file

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • host_scratch (Boolean)
  • owner (String[1]) (defaults to: 'root')
  • group (String[1]) (defaults to: 'root')
  • mode (Stdlib::Filemode) (defaults to: '0444')
  • ensure (Wmflib::Ensure) (defaults to: 'present')
  • path (Stdlib::Unixpath) (defaults to: $title)


3
4
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
# File 'modules/cloudnfs/manifests/volume_config.pp', line 3

define cloudnfs::volume_config (
    Boolean          $host_scratch,
    String[1]        $owner  = 'root',
    String[1]        $group  = 'root',
    Stdlib::Filemode $mode   = '0444',
    Wmflib::Ensure   $ensure = 'present',
    Stdlib::Unixpath $path   = $title,
) {
    include cloudnfs::volume_data

    if $host_scratch {
        # A list of 'public' volumes hosted on this server. Public volumes
        # have permissive exports that let anyone attach.
        $public = {
            'scratch' => '/srv/scratch *(rw,sec=sys,sync,no_subtree_check,root_squash)',
        }
    } else {
        $public = {}
    }

    $data = {
        'public'  => $public,
        'private' => $cloudnfs::volume_data::projects,
    }

    file { $path:
        ensure  => stdlib::ensure($ensure, 'file'),
        content => $data.to_yaml,
        owner   => $owner,
        group   => $group,
        mode    => $mode,
    }
}