aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-07-15 11:25:27 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-08-14 13:24:32 +0200
commit81ec6f92f400f667c2ce9d879396bfff00ec5bb2 (patch)
treee39ed0ddd4e8b87488732af4d8c949135d2aa9af /modules
parentd8dd2fc39ae329ceefbb1a695579858403705880 (diff)
downloadPuppet-81ec6f92f400f667c2ce9d879396bfff00ec5bb2.tar.gz
Puppet-81ec6f92f400f667c2ce9d879396bfff00ec5bb2.tar.zst
Puppet-81ec6f92f400f667c2ce9d879396bfff00ec5bb2.zip
Add file store role
Diffstat (limited to 'modules')
-rw-r--r--modules/role/manifests/file_store.pp36
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/role/manifests/file_store.pp b/modules/role/manifests/file_store.pp
new file mode 100644
index 0000000..1d3ee49
--- /dev/null
+++ b/modules/role/manifests/file_store.pp
@@ -0,0 +1,36 @@
1class role::file_store (
2 Optional[Array] $nfs_mounts = ["cardano"],
3 Optional[String] $mountpoint = "/fichiers1",
4) {
5 include "base_installation"
6
7 include "profile::fstab"
8 include "profile::tools"
9 include "profile::monitoring"
10
11 unless empty($mountpoint) {
12 class { "::nfs":
13 server_enabled => true,
14 nfs_v4 => true,
15 nfs_v4_export_root => '/exports',
16 nfs_v4_export_root_clients => 'localhost(rw)',
17 require => Mount[$mountpoint],
18 }
19
20 $nfs_mounts.each |$nfs_mount| {
21 file { "$mountpoint/$nfs_mount":
22 ensure => "directory",
23 mode => "0755",
24 owner => "nobody",
25 group => "nobody",
26 require => Mount[$mountpoint],
27 } ->
28 nfs::server::export { "$mountpoint/$nfs_mount":
29 owner => "nobody",
30 group => "nobody",
31 ensure => "present",
32 clients => "immae.eu(rw,secure,sync,all_squash,sec=krb5p)",
33 }
34 }
35 }
36}