Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
fix markdown for github
Browse files Browse the repository at this point in the history
  • Loading branch information
dwerder authored May 3, 2017
1 parent bd7d70c commit 57c7363
Showing 1 changed file with 56 additions and 68 deletions.
124 changes: 56 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#nfs
# nfs

####Table of Contents
#### Table of Contents

1. [Overview - What is the nfs module?](#overview)
2. [Module Description - What does this module do?](#module-description)
Expand All @@ -20,27 +20,27 @@
6. [Limitations - OS compatibility, etc.](#limitations)
7. [Contributing to the graphite module](#contributing)

##Overview
## Overview

This module installs, configures and manages everything on NFS clients and servers.

[![Puppet Forge](http://img.shields.io/puppetforge/v/echocat/nfs.svg)](https://forge.puppetlabs.com/echocat/nfs)
[![Build Status](https://secure.travis-ci.org/echocat/puppet-nfs.png?branch=master)](https://travis-ci.org/echocat/puppet-nfs)
[![Puppet Forge Downloads](http://img.shields.io/puppetforge/dt/echocat/nfs.svg)](https://forge.puppetlabs.com/echocat/nfs)

##Module Description
## Module Description

This module can be used to simply mount nfs shares on a client or to configure your nfs servers.
It can make use of storeconfigs on the puppetmaster to get its resources.

##Setup
## Setup

**What nfs affects:**

* packages/services/configuration files for NFS usage
* can be used with puppet storage

###Simple mount nfs share
### Simple mount nfs share

This example mounts a nfs share on the client, with NFSv3

Expand All @@ -54,7 +54,7 @@ include '::nfs::client'
}
```

###NFSv3 server and client
### NFSv3 server and client

This will export /data/folder on the server and automagically mount it on client.
You need storeconfigs/puppetdb for this to work.
Expand All @@ -80,7 +80,7 @@ node client {
}
```

###NFSv3 multiple exports, servers and multiple node
### NFSv3 multiple exports, servers and multiple node

```puppet
node server1 {
Expand Down Expand Up @@ -148,7 +148,7 @@ node client {
}
```

###NFSv4 Simple example
### NFSv4 Simple example

We use the `$::domain` fact for the Domain setting in `/etc/idmapd.conf`.
For NFSv4 to work this has to be equal on servers and clients
Expand Down Expand Up @@ -217,7 +217,7 @@ node client2 {
}
```

###NFSv4 insanely overcomplicated reference
### NFSv4 insanely overcomplicated reference

Just to show you, how complex we can make things ;-)

Expand Down Expand Up @@ -327,38 +327,38 @@ nfs::server::export {'/data':

You can also give options to each host in a hash, and then use the stdlib keys() function to extract the client array from the hash: `mk_client_list(keys($client_hash), $client_hash, '')`

##Usage
## Usage

####Class: `nfs::server`
#### Class: `nfs::server`

Set up NFS server and exports. NFSv3 and NFSv4 supported.

**Parameters within `nfs::server`:**

#####`service_manage` (true)
##### `service_manage` (true)

Should this class manage the services behind nfs? Set this to false
if you are managing the service in another way (e.g. pacemaker).

#####`package_ensure` (installed)
##### `package_ensure` (installed)

Allow to update or set to a specific version the nfs server packages.

#####`nfs_v4` (optional)
##### `nfs_v4` (optional)

NFSv4 support. Will set up automatic bind mounts to export root.
Disabled by default.

#####`nfs_v4_export_root` (optional)
##### `nfs_v4_export_root` (optional)

Export root, where we bind mount shares, default /export

#####`nfs_v4_idmap_domain` (optional)
##### `nfs_v4_idmap_domain` (optional)

Domain setting for idmapd, must be the same across server
and clients. Default is to use $domain fact.

#####`exports` (optional)
##### `exports` (optional)

If set, this attribute will be used to
construct nfs::server::export resources. You can use you ENC or hiera to
Expand All @@ -371,7 +371,7 @@ nfs::server::exports:
clients: '*(fsid=0,ro,insecure,async,all_squash,no_subtree_check,mountpoint=/mnt/something)'
```

#####Examples
##### Examples

```puppet
class { '::nfs::server':
Expand All @@ -383,65 +383,66 @@ class { '::nfs::server':
}
```

####Defined Type: `nfs::server::export`
#### Defined Type: `nfs::server::export`

Set up NFS export on the server (and stores data in configstore)

**Parameters within `nfs::server::export`:**

#####`v3_export_name` (optional)
##### `v3_export_name` (optional)

Default is `$name`. Usally you do not set it explicit.

#####`v4_export_name` (optional)
##### `v4_export_name` (optional)

Default results from `$name`. Usally you do not set it explicit.

#####`ensure` (optional)
##### `ensure` (optional)

Default is 'mounted'

#####`bind` (optional)
##### `bind` (optional)

Default is 'rbind'.
rbind or bind mounting of folders bindmounted into /export. Google it!

**Following parameteres are propogated by to storeconfigs to clients**

#####`mount` (optional)
##### `mount` (optional)

Default is undef. This means client mount path is the same as server export path.
Directory where we want export mounted on client

#####`remounts` (optional)
##### `remounts` (optional)

Default is false.

#####`atboot` (optional)
##### `atboot` (optional)

Default is false.

#####`options` (optional)
##### `options` (optional)

Default is '_netdev'. Don't remove that option, but feel free to add more.

#####`bindmount` (optional)
##### `bindmount` (optional)

Default is undef. If set will mount share inside /srv (or overridden mount_root)
and then bindmount to another directory elsewhere in the fs - for fanatics.

#####`nfstag` (optional)
##### `nfstag` (optional)

Default is undef. Used to identify a catalog item for filtering by storeconfigs on clients.

#####`clients` (optional)
##### `clients` (optional)

Default is 'localhost(ro)'. Copied directly into /etc/exports as a string, for simplicity.

#####`server` (optional)
##### `server` (optional)

Default is `$::clientcert`. Used to specify a other ip/name for the client to connect to. Usefull in machines with multiple ip addresses or network interfaces
#####Example

##### Example

```puppet
::nfs::server::export { '/media_library':
Expand All @@ -450,31 +451,31 @@ Default is `$::clientcert`. Used to specify a other ip/name for the client to co
}
```

####Class: `nfs::client`
#### Class: `nfs::client`

Set up NFS client and mounts. NFSv3 and NFSv4 supported.

**Parameters within `nfs::client`:**

#####`package_ensure` (installed)
##### `package_ensure` (installed)

Allow to update or set to a specific version the nfs client packages.

#####`nfs_v4`
##### `nfs_v4`

NFSv4 support.
Disabled by default.

#####`nfs_v4_mount_root`
##### `nfs_v4_mount_root`

Mount root, where we mount shares, default /srv

#####`nfs_v4_idmap_domain`
##### `nfs_v4_idmap_domain`

Domain setting for idmapd, must be the same across server
and clients. Default is to use $::domain fact.

#####`mounts` (optional)
##### `mounts` (optional)

If set, this attribute will be used to construct nfs::client::mount resources.
You can use you ENC or hiera to provide the hash of nfs::client::mount
Expand All @@ -488,7 +489,7 @@ nfs::client::mounts:
share: '/export/data'
```

#####Example
##### Example

```puppet
class { '::nfs::client':
Expand All @@ -499,79 +500,66 @@ class { '::nfs::client':
}
```

####Defined Type: `nfs::client::mount`
#### Defined Type: `nfs::client::mount`

Set up NFS mount on client.

**Parameters within `nfs::client::mount`:**

#####`server`
##### `server`

FQDN or IP of the NFS server.

#####`share`
##### `share`

Name of share to be mounted.

#####`ensure` (optional)
##### `ensure` (optional)

Default is 'mounted'.

#####`mount` (optional)
##### `mount` (optional)

Default is `$title` of defined type. Defines mountpoint of the share on the client.

#####`remounts` (optional)
##### `remounts` (optional)

Default is false.

#####`atboot` (optional)
##### `atboot` (optional)

Default is false.

#####`options` (optional)
##### `options` (optional)

Default is '_netdev'. Don't remove that option, but feel free to add more.

#####`bindmount` (optional)
##### `bindmount` (optional)

Default is undef. If set will mount share inside /srv (or overridden mount_root)
and then bindmount to another directory elsewhere in the fs - for fanatics.

#####`nfstag` (optional)
##### `nfstag` (optional)

Default is undef. Used to identify a catalog item for filtering by storeconfigs on clients.

#####`owner` (optional)
##### `owner` (optional)

Default is 'root'. Sets owner of mountpoint directory. This is applied to the directory on every run, which means it is used both on the base mountpoint creation when unmounted, and also once mounted on the target NFS server and thus all servers accessing the same share.


#####`group` (optional)
##### `group` (optional)

Default is `root`. Sets group of mountpoint directory. This is applied to the directory on every run, which means it is used both on the base mountpoint creation when unmounted, and also once mounted on the target NFS server and thus all servers accessing the same share.


#####`perm` (optional)
##### `perm` (optional)

Default is '0755'. Sets mode of mountpoint directory. This has changed from previous versons which used '0777' (world writable). This is applied to the directory on every run, which means it is used both on the base mountpoint creation when unmounted, and also once mounted on the target NFS server and thus all servers accessing the same share.


##Requirements
## Requirements

If you want to have the full potential of this module its recommend to have storeconfigs enabled.

###Modules needed:

* stdlib by puppetlabs
* concat by puppetlabs

###Software versions needed:

* facter > 1.6.2
* puppet > 2.6.2

##Limitations
## Limitations

##Contributing

Expand Down

0 comments on commit 57c7363

Please sign in to comment.