diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | environments/global/roles/file_store.yaml | 4 | ||||
m--------- | external_modules/nfs | 0 | ||||
-rw-r--r-- | modules/role/manifests/file_store.pp | 36 |
4 files changed, 43 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules index f8ff2b7..f5d2bd0 100644 --- a/.gitmodules +++ b/.gitmodules | |||
@@ -73,3 +73,6 @@ | |||
73 | [submodule "external_modules/augeasproviders_core"] | 73 | [submodule "external_modules/augeasproviders_core"] |
74 | path = external_modules/augeasproviders_core | 74 | path = external_modules/augeasproviders_core |
75 | url = git://git.immae.eu/github/hercules-team/augeasproviders_core.git | 75 | url = git://git.immae.eu/github/hercules-team/augeasproviders_core.git |
76 | [submodule "external_modules/nfs"] | ||
77 | path = external_modules/nfs | ||
78 | url = git://git.immae.eu/github/derdanne/puppet-nfs | ||
diff --git a/environments/global/roles/file_store.yaml b/environments/global/roles/file_store.yaml new file mode 100644 index 0000000..c0912e2 --- /dev/null +++ b/environments/global/roles/file_store.yaml | |||
@@ -0,0 +1,4 @@ | |||
1 | --- | ||
2 | classes: | ||
3 | role::file_store: ~ | ||
4 | letsencrypt::hosts: "%{lookup('base_installation::system_hostname')}" | ||
diff --git a/external_modules/nfs b/external_modules/nfs new file mode 160000 | |||
Subproject 24020205590d9ae942e0acf79c1506b40ab09e4 | |||
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 @@ | |||
1 | class 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 | } | ||