robertdebock.nfsserver
Ansible Role NFS Server
This document explains how to set up exports on an NFS server.
GitHub | GitLab | Downloads | Version |
---|---|---|---|
Example Playbook
The following example is from molecule/default/converge.yml
and is tested each time changes are made.
---
- name: Converge
hosts: all
become: true
gather_facts: true
roles:
- role: robertdebock.nfsserver
nfsserver_exports:
- share: /mnt/export
owner: root
group: root
mode: "0755"
hosts:
- name: "10.0.0.0/24"
options:
- ro
- no_subtree_check
- nohide
- name: "172.16.0.0/24"
options:
- rw
- sync
- no_wdelay
- share: /mnt/export2
owner: root
group: root
mode: "0755"
hosts:
- name: "10.2.3.0/24"
options:
- ro
Before using the NFS role, the machine needs to be prepared. This is done with molecule/default/prepare.yml
:
---
- name: Prepare
hosts: all
become: true
gather_facts: false
roles:
- role: robertdebock.bootstrap
For a detailed guide, see this explanation and example.
Role Variables
The default variable values are found in defaults/main.yml
:
---
# Default values for nfsserver
# You can list exports like this:
# nfsserver_exports:
# - share: /mnt/export
# owner: root
# group: root
# mode: "0755"
# hosts:
# - name: "10.0.0.0/24"
# options:
# - ro
# - no_subtree_check
# - nohide
nfsserver_exports: []
# Exports file location.
nfsserver_exports_file: /etc/exports
Requirements
- Install pip packages listed in requirements.txt.
State of Used Roles
You can prepare your system differently, but the following roles can be used:
Requirement | GitHub | GitLab |
---|---|---|
robertdebock.bootstrap |
Context
This role works with other compatible roles. For more info, check the documentation of these roles.
Here’s an overview of related roles:
Compatibility
This role has been tested on these container images:
Container | Tags |
---|---|
Alpine | all |
Amazon | Candidate |
EL | 9 |
Debian | all |
Fedora | all |
Ubuntu | all |
The minimum required Ansible version is 2.12. Tests have been done on:
- The previous version.
- The current version.
- The development version.
If you discover issues, please report them on GitHub.
License
This role is licensed under the Apache-2.0.
Author Information
This role was created by robertdebock.
Consider sponsoring me.
Setup exports on an nfs server
ansible-galaxy install robertdebock.nfsserver