-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the option to create the exported directory on the NFS server or …
…not.
- Loading branch information
Showing
6 changed files
with
59 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
|
||
* [`nfs::client::mount`](#nfs--client--mount): Function: nfs::client::mount This Function exists to 1. manage all mounts on a nfs client Parameters param nfs_v4 Boolean. When set to | ||
* [`nfs::functions::bindmount`](#nfs--functions--bindmount): Function: nfs::functions::bindmount This Function exists to 1. manage bindmounts * Daniel Klockenkaemper <mailto:[email protected]> | ||
* [`nfs::functions::create_export`](#nfs--functions--create_export): Function: nfs::functions::create_export This Function exists to 1. manage export creation * Daniel Klockenkaemper <mailto:dk@marketing-fac | ||
* [`nfs::functions::create_export`](#nfs--functions--create_export): Function: nfs::functions::create_export This Function exists to 1. manage export creation @param*create_dir Boolean. Create the directo | ||
* [`nfs::functions::mkdir`](#nfs--functions--mkdir): Function: nfs::functions::mkdir This Function exists to 1. manage dir creation * Daniel Klockenkaemper <mailto:[email protected]> * | ||
* [`nfs::functions::nfsv4_bindmount`](#nfs--functions--nfsv4_bindmount): Function: nfs::functions::nfsv4_bindmount This Function exists to 1. manage bindmounts for nfs4 * Daniel Klockenkaemper <mailto:dk@marketi | ||
* [`nfs::server::export`](#nfs--server--export): Function: nfs::server::export This Function exists to 1. manage all exported resources on a nfs server Parameters class { '::nfs': serv | ||
|
@@ -1097,6 +1097,10 @@ Function: nfs::functions::create_export | |
This Function exists to | ||
1. manage export creation | ||
|
||
@param*create_dir | ||
Boolean. Create the directory to be exported. | ||
Defaults to true. | ||
|
||
* Daniel Klockenkaemper <mailto:[email protected]> | ||
* Martin Alfke <[email protected]> | ||
|
||
|
@@ -1109,6 +1113,7 @@ The following parameters are available in the `nfs::functions::create_export` de | |
* [`owner`](#-nfs--functions--create_export--owner) | ||
* [`group`](#-nfs--functions--create_export--group) | ||
* [`mode`](#-nfs--functions--create_export--mode) | ||
* [`create_dir`](#-nfs--functions--create_export--create_dir) | ||
|
||
##### <a name="-nfs--functions--create_export--clients"></a>`clients` | ||
|
||
|
@@ -1148,6 +1153,14 @@ String. Sets the permissions of the exported directory. | |
|
||
Default value: `undef` | ||
|
||
##### <a name="-nfs--functions--create_export--create_dir"></a>`create_dir` | ||
|
||
Data type: `Boolean` | ||
|
||
|
||
|
||
Default value: `true` | ||
|
||
### <a name="nfs--functions--mkdir"></a>`nfs::functions::mkdir` | ||
|
||
Function: nfs::functions::mkdir | ||
|
@@ -1260,6 +1273,7 @@ The following parameters are available in the `nfs::server::export` defined type | |
* [`v3_export_name`](#-nfs--server--export--v3_export_name) | ||
* [`v4_export_name`](#-nfs--server--export--v4_export_name) | ||
* [`nfsv4_bindmount_enable`](#-nfs--server--export--nfsv4_bindmount_enable) | ||
* [`create_dir`](#-nfs--server--export--create_dir) | ||
|
||
##### <a name="-nfs--server--export--clients"></a>`clients` | ||
|
||
|
@@ -1402,3 +1416,12 @@ Data type: `Boolean` | |
|
||
Default value: `$nfs::nfsv4_bindmount_enable` | ||
|
||
##### <a name="-nfs--server--export--create_dir"></a>`create_dir` | ||
|
||
Data type: `Boolean` | ||
|
||
Boolean. Create the directory to be exported. | ||
Defaults to true. | ||
|
||
Default value: `true` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,18 @@ | |
# @param mode | ||
# String. Sets the permissions of the exported directory. | ||
# | ||
# @param create_dir | ||
# Boolean. Create the directory to be exported. | ||
# Defaults to true. | ||
# | ||
# @author | ||
# * Daniel Klockenkaemper <mailto:[email protected]> | ||
# * Martin Alfke <[email protected]> | ||
# | ||
define nfs::functions::create_export ( | ||
Variant[String[1], Array[String[1]]] $clients, | ||
String[1] $ensure = 'present', | ||
Boolean $create_dir = true, | ||
Optional[String[1]] $owner = undef, | ||
Optional[String[1]] $group = undef, | ||
Optional[String[1]] $mode = undef, | ||
|
@@ -38,13 +43,16 @@ | |
content => $line, | ||
} | ||
|
||
# Create the directory path only if a File resource isn't | ||
# # defined previously AND the $create_dir boolean is true. | ||
unless defined(File[$name]) { | ||
file { $name: | ||
ensure => directory, | ||
owner => $owner, | ||
group => $group, | ||
mode => $mode, | ||
selinux_ignore_defaults => true, | ||
if $create_dir { | ||
filepath { $name: | ||
ensure => present, | ||
owner => $owner, | ||
group => $group, | ||
mode => $mode, | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters