|
1 | 1 | # Class: s3fs::mount
|
2 | 2 | #
|
3 | 3 | # This module installs s3fs
|
4 |
| -# |
5 |
| -# Parameters: |
6 |
| -# |
7 |
| -# [*bucket*] - AWS bucket name |
8 |
| -# [*mount_point*] - Mountpoint for bucket |
9 |
| -# [*ensure*] - Set mountpoint values, ensure dir and mount are absent |
10 |
| -# [*s3url*] - 'https://s3.amazonaws.com' |
11 |
| -# [*default_acl*] - 'private' |
12 |
| -# [*uid*] - Mountpoint and mount dir owner |
13 |
| -# [*gid*] - Mountpoint and mount dir group |
14 |
| -# [*mode*] - Mountpoint and moutn dir permissions |
15 |
| -# [*atboot*] - 'true', |
16 |
| -# [*device*] - "s3fs#${bucket}", |
17 |
| -# [*fstype*] - 'fuse', |
18 |
| -# [*options*] - "allow_other,uid=${uid},gid=${gid},default_acl=${default_acl},use_cache=/tmp/aws_s3_cache,url=${s3url}", |
19 |
| -# [*remounts*] - 'false', |
20 |
| -# |
21 |
| -# Actions: |
22 |
| -# |
23 |
| -# Requires: |
24 |
| -# Class['s3fs'] |
25 |
| -# |
26 |
| -# Sample Usage: |
27 |
| -# |
28 |
| -# # S3FS |
29 |
| -# s3fs::mount {'Testing': |
30 |
| -# bucket => 'testvgh1', |
31 |
| -# mount_point => '/srv/testvgh1', |
32 |
| -# uid => '1001', |
33 |
| -# gid => '1001', |
34 |
| -# } |
35 | 4 | # ## S3FS
|
36 | 5 | # s3fs::mount {'Testvgh':
|
37 | 6 | # bucket => 'testvgh',
|
|
40 | 9 | # }
|
41 | 10 | #
|
42 | 11 | define s3fs::mount (
|
43 |
| - $bucket = hiera('drupal::s3fs_bucket', 'drupal-stage'), |
44 |
| - $mount_point = hiera('drupal::s3fs_mount', '/opt/wwc/drupal-s3-files'), |
| 12 | + $bucket, |
| 13 | + $mount_point, |
45 | 14 | $ensure = 'present',
|
46 | 15 | $default_acl = 'private',
|
47 |
| - $uid = '33', |
48 |
| - $gid = '33', |
| 16 | + $uid = '0', |
| 17 | + $gid = '0', |
49 | 18 | $mode = '0660',
|
50 |
| - $atboot = 'true', |
| 19 | + $atboot = true, |
51 | 20 | $fstype = 'fuse',
|
52 |
| - $remounts = 'false', |
| 21 | + $remounts = false, |
53 | 22 | $cache = '/mnt/aws_s3_cache',
|
54 |
| - $group = 'www-data', |
55 |
| - $owner = 'www-data', |
| 23 | + $group = 'root', |
| 24 | + $owner = 'root', |
56 | 25 | ) {
|
57 | 26 |
|
58 | 27 | include s3fs
|
59 |
| - Class['s3fs'] -> S3fs::Mount["${name}"] |
| 28 | + Class['s3fs'] -> S3fs::Mount[$name] |
60 | 29 |
|
61 |
| - # Declare this here, otherwise, uid, guid, etc.. are not initialized in the correct order. |
62 | 30 | $options = "gid=$gid,uid=$uid,default_acl=${default_acl},use_cache=${cache}"
|
63 | 31 | $device = "s3fs#${bucket}"
|
64 | 32 |
|
|
76 | 44 | }
|
77 | 45 | }
|
78 | 46 |
|
79 |
| - File["${mount_point}"] -> Mount["${mount_point}"] |
| 47 | + File[$mount_point] -> Mount[$mount_point] |
80 | 48 |
|
81 | 49 | file { $mount_point:
|
82 | 50 | ensure => $ensure_dir,
|
|
0 commit comments