forked from chloeandisabel/puppet-s3fs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmount.pp
67 lines (60 loc) · 1.41 KB
/
mount.pp
1
2
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
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
# Class: s3fs::mount
#
# This module installs s3fs
# ## S3FS
# s3fs::mount {'Testvgh':
# bucket => 'testvgh',
# mount_point => '/srv/testvgh2',
# default_acl => 'public-read',
# }
#
define s3fs::mount (
$bucket,
$mount_point,
$ensure = 'present',
$default_acl = 'private',
$uid = '0',
$gid = '0',
$mode = '0660',
$atboot = true,
$fstype = 'fuse',
$remounts = false,
$cache = '/mnt/aws_s3_cache',
$group = 'root',
$owner = 'root',
$perm_recurse = true,
) {
Class['s3fs'] -> S3fs::Mount[$name]
$options = "allow_other,gid=$gid,uid=$uid,default_acl=${default_acl},use_cache=${cache}"
$device = "s3fs#${bucket}"
case $ensure {
present, defined, unmounted, mounted: {
$ensure_mount = 'mounted'
$ensure_dir = 'directory'
}
absent: {
$ensure_mount = 'absent'
$ensure_dir = 'absent'
}
default: {
fail("Not a valid ensure value: ${ensure}")
}
}
File[$mount_point] -> Mount[$mount_point]
file { $mount_point:
recurse => $perm_recurse,
ensure => $ensure_dir,
force => true,
owner => $owner,
group => $group,
mode => $mode,
}
mount{ $mount_point:
ensure => $ensure_mount,
atboot => $atboot,
device => $device,
fstype => $fstype,
options => $options,
remounts => $remounts,
}
}