Rev | Line | |
---|
[578] | 1 | import "classes/*.pp" |
---|
| 2 | |
---|
| 3 | define share_dirs($share_root) { |
---|
| 4 | |
---|
[583] | 5 | file { "${share_root}/$name": |
---|
| 6 | ensure => directory, |
---|
| 7 | owner => "root", |
---|
| 8 | group => "root", |
---|
| 9 | mode => 755, |
---|
| 10 | } |
---|
[578] | 11 | } |
---|
| 12 | |
---|
| 13 | define share_mounts($share_root, $volgroup) { |
---|
| 14 | |
---|
[583] | 15 | mount { "${share_root}/$name": |
---|
| 16 | ensure => mounted, |
---|
| 17 | device => "${volgroup}/$name", |
---|
| 18 | atboot => true, |
---|
| 19 | fstype => "ext3", |
---|
| 20 | options => "defaults,nosuid", |
---|
| 21 | require => File["${share_root}/$name"], |
---|
| 22 | } |
---|
[578] | 23 | } |
---|
| 24 | |
---|
| 25 | define nfs_share ($shares, $volgroup, $share_access = "*.$domain", $share_options = "rw,sync") { |
---|
| 26 | |
---|
[583] | 27 | include nfs_server |
---|
[578] | 28 | |
---|
[583] | 29 | share_dirs { $shares: share_root => $name } # $shares is an array |
---|
| 30 | # share_mounts { $shares: share_root => $name, volgroup => $volgroup } # $shares is an array |
---|
[578] | 31 | |
---|
[583] | 32 | file { "/etc/exports": |
---|
| 33 | owner => "root", |
---|
| 34 | group => "root", |
---|
| 35 | mode => 644, |
---|
| 36 | content => template("nfs_server/etc-exports.erb"), |
---|
| 37 | notify => Service["nfs-kernel-server"], |
---|
| 38 | } |
---|
[578] | 39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.