From 81ec6f92f400f667c2ce9d879396bfff00ec5bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 15 Jul 2018 11:25:27 +0200 Subject: Add file store role --- modules/role/manifests/file_store.pp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 modules/role/manifests/file_store.pp (limited to 'modules/role') 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 @@ +class role::file_store ( + Optional[Array] $nfs_mounts = ["cardano"], + Optional[String] $mountpoint = "/fichiers1", +) { + include "base_installation" + + include "profile::fstab" + include "profile::tools" + include "profile::monitoring" + + unless empty($mountpoint) { + class { "::nfs": + server_enabled => true, + nfs_v4 => true, + nfs_v4_export_root => '/exports', + nfs_v4_export_root_clients => 'localhost(rw)', + require => Mount[$mountpoint], + } + + $nfs_mounts.each |$nfs_mount| { + file { "$mountpoint/$nfs_mount": + ensure => "directory", + mode => "0755", + owner => "nobody", + group => "nobody", + require => Mount[$mountpoint], + } -> + nfs::server::export { "$mountpoint/$nfs_mount": + owner => "nobody", + group => "nobody", + ensure => "present", + clients => "immae.eu(rw,secure,sync,all_squash,sec=krb5p)", + } + } + } +} -- cgit v1.2.3