Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
|
955324cb82 | |
|
146f9ba1d4 | |
|
5a9d0cf184 | |
|
38cacfe240 | |
|
501bd47a6e | |
|
1524482417 | |
|
361a1e0cee |
|
@ -0,0 +1,19 @@
|
||||||
|
|
||||||
|
## v1.1.1
|
||||||
|
|
||||||
|
### Enhancements
|
||||||
|
* Improved documentation and fixed typos.
|
||||||
|
|
||||||
|
## v1.1
|
||||||
|
|
||||||
|
### Enhancements
|
||||||
|
* Manage client configuration file.
|
||||||
|
* List the ports used by rpcbind.
|
||||||
|
* Set statd and quotad ports.
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
## v1.0
|
||||||
|
|
||||||
|
### Features
|
||||||
|
* Install nfs client for Debian.
|
20
README.md
20
README.md
|
@ -1,4 +1,5 @@
|
||||||
# NFS
|
# NFS - Projet **ARRÊTÉ** au profit de [debops.nfs][debops nfs] et [debops.nfs_server][debops nfs server].
|
||||||
|
|
||||||
|
|
||||||
1. [Overview](#overview)
|
1. [Overview](#overview)
|
||||||
2. [Role Variables](#role-variables)
|
2. [Role Variables](#role-variables)
|
||||||
|
@ -11,12 +12,23 @@
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Manage NFS (client) installation.
|
This role manages NFS client installation and configuration using fixed ports.
|
||||||
|
|
||||||
## Role Variables
|
## Role Variables
|
||||||
|
|
||||||
* **nfs_cli_manage** : If `nfs-client` should be managed with this role [default : `true`].
|
* **nfs_cli_manage** : If `nfs-client` should be managed with this role [default : `true`].
|
||||||
* **nfs_cli_pkg_state** : State of new `nfs-client` package(s) [default : `installed`].
|
* **nfs_cli_pkg_state** : State of new `nfs-client` package(s) [default : `installed`].
|
||||||
|
* **nfs_cli_conf_path** : Configuration file for `nfs-client` [default : `/etc/default/nfs-common`].
|
||||||
|
* **nfs_cli_conf_tpl** : Template used to generate the previous config file [default : `etc/default/nfs-common.j2`].
|
||||||
|
* **nfs_quota_conf_path** : Configuration file for `quota` (`nfs-client`) [default : `/etc/default/quota`].
|
||||||
|
* **nfs_quota_conf_tpl** : Template used to generate the previous config file [default : `etc/default/quota.j2`].
|
||||||
|
* **nfs_rpc_nfsd** : Port used by the NFS server [default : `2049`].
|
||||||
|
* **nfs_rpc_nfs_cb** : Port used by RPC callback [default : `32764`].
|
||||||
|
* **nfs_rpc_statd_bc** : Port used by RPC statd broadcast [default : `32765`].
|
||||||
|
* **nfs_rpc_statd** : Port used by RPC statd listener [default : `32766`].
|
||||||
|
* **nfs_rpc_mountd** : Port used by RPC mountd [default : `32767`].
|
||||||
|
* **nfs_rpc_lockd** : Port used by RPC nlock manager [default : `32768`].
|
||||||
|
* **nfs_rpc_quotad** : Port used by RPC quotad [default : `32769`].
|
||||||
|
|
||||||
### OS Specific Variables
|
### OS Specific Variables
|
||||||
|
|
||||||
|
@ -38,6 +50,8 @@ Please see default value by Operating System file in [vars][vars directory] dire
|
||||||
|
|
||||||
This role will :
|
This role will :
|
||||||
* Install needed packages to provide `nfs-client`.
|
* Install needed packages to provide `nfs-client`.
|
||||||
|
* Manage `nfs-client` configuration files.
|
||||||
|
* Fix rpcbind ports.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
@ -63,3 +77,5 @@ Jérémy Gardais
|
||||||
[nfs github]: https://github.com/ipr-cnrs/nfs
|
[nfs github]: https://github.com/ipr-cnrs/nfs
|
||||||
[wtfpl website]: http://www.wtfpl.net/about/
|
[wtfpl website]: http://www.wtfpl.net/about/
|
||||||
[ipr website]: https://ipr.univ-rennes1.fr/
|
[ipr website]: https://ipr.univ-rennes1.fr/
|
||||||
|
[debops nfs]: https://github.com/debops/debops/tree/master/ansible/roles/debops.nfs
|
||||||
|
[debops nfs server]: https://github.com/debops/debops/tree/master/ansible/roles/debops.nfs_server
|
|
@ -4,3 +4,17 @@
|
||||||
# client
|
# client
|
||||||
nfs_cli_manage: true
|
nfs_cli_manage: true
|
||||||
nfs_cli_pkg_state: 'installed'
|
nfs_cli_pkg_state: 'installed'
|
||||||
|
nfs_cli_conf_path: '/etc/default/nfs-common'
|
||||||
|
nfs_cli_conf_tpl: 'etc/default/nfs-common.j2' # TODO : hide this variable from user, this is for this role's internal use
|
||||||
|
|
||||||
|
nfs_quota_conf_path: '/etc/default/quota'
|
||||||
|
nfs_quota_conf_tpl: 'etc/default/quota.j2' # TODO : hide this variable from user, this is for this role's internal use
|
||||||
|
|
||||||
|
# rpcbind
|
||||||
|
nfs_rpc_nfsd: '2049'
|
||||||
|
nfs_rpc_nfs_cb: '32764'
|
||||||
|
nfs_rpc_statd_bc: '32765'
|
||||||
|
nfs_rpc_statd: '32766'
|
||||||
|
nfs_rpc_mountd: '32767'
|
||||||
|
nfs_rpc_lockd: '32768'
|
||||||
|
nfs_rpc_quotad: '32769'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: "Jérémy Gardais"
|
author: "Jérémy Gardais"
|
||||||
description: "Manage NFS (client/server) installation and configuration"
|
description: "This role manages NFS client installation and configuration using fixed ports"
|
||||||
license: WTFPL
|
license: WTFPL
|
||||||
company: IPR
|
company: IPR
|
||||||
issue_tracker_url: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.nfs/issues
|
issue_tracker_url: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.nfs/issues
|
||||||
|
|
|
@ -1,18 +1,60 @@
|
||||||
---
|
---
|
||||||
# tasks file for nfs
|
# tasks file for role nfs
|
||||||
|
|
||||||
- name: Load specific OS vars for nfs
|
- name: load operating system specific variables for nfs
|
||||||
include_vars: "{{ item }}"
|
include_vars: "{{ item }}" # includes yml file containing os specific variable, eg "debian.yml" found in role_root/vars
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
|
||||||
- "{{ ansible_distribution|lower }}.yml"
|
- "{{ ansible_distribution|lower }}.yml"
|
||||||
- "{{ ansible_os_family|lower }}.yml"
|
- "{{ ansible_os_family|lower }}.yml"
|
||||||
|
|
||||||
# client {{{
|
# client {{{
|
||||||
- name: client package
|
- name: ensure nfs client package is in the required install state
|
||||||
package:
|
package:
|
||||||
name: '{{ item }}'
|
name: '{{ item }}' # TODO: why not simply {{ nfs_cli_pkg_list }} ?
|
||||||
state: '{{ nfs_cli_pkg_state }}'
|
state: '{{ nfs_cli_pkg_state }}'
|
||||||
with_items:
|
with_items:
|
||||||
- '{{ nfs_cli_pkg_list }}'
|
- '{{ nfs_cli_pkg_list }}'
|
||||||
|
when: nfs_cli_manage
|
||||||
|
|
||||||
|
- name: configure nfs-client
|
||||||
|
template:
|
||||||
|
src: '{{ nfs_cli_conf_tpl }}'
|
||||||
|
dest: '{{ nfs_cli_conf_path }}'
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
backup: true
|
||||||
|
when: nfs_cli_manage
|
||||||
|
|
||||||
|
- name: configure nfs-quota
|
||||||
|
template:
|
||||||
|
src: '{{ nfs_quota_conf_tpl }}'
|
||||||
|
dest: '{{ nfs_quota_conf_path }}'
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
backup: true
|
||||||
|
when: nfs_cli_manage
|
||||||
|
|
||||||
|
- name: declare rpcbind ports in /etc/services
|
||||||
|
blockinfile:
|
||||||
|
state: present
|
||||||
|
insertafter: EOF
|
||||||
|
dest: /etc/services
|
||||||
|
marker: "# {mark} add services ANSIBLE ipr-cnrs.nfs"
|
||||||
|
content: |
|
||||||
|
rpc.nfs-cb {{ nfs_rpc_nfs_cb }}/tcp # RPC nfs callback
|
||||||
|
rpc.nfs-cb {{ nfs_rpc_nfs_cb }}/udp # RPC nfs callback
|
||||||
|
rpc.statd-bc {{ nfs_rpc_statd_bc }}/tcp # RPC statd broadcast
|
||||||
|
rpc.statd-bc {{ nfs_rpc_statd_bc }}/udp # RPC statd broadcast
|
||||||
|
rpc.statd {{ nfs_rpc_statd }}/tcp # RPC statd listen
|
||||||
|
rpc.statd {{ nfs_rpc_statd }}/udp # RPC statd listen
|
||||||
|
rpc.mountd {{ nfs_rpc_mountd }}/tcp # RPC mountd
|
||||||
|
rpc.mountd {{ nfs_rpc_mountd }}/udp # RPC mountd
|
||||||
|
rpc.lockd {{ nfs_rpc_lockd }}/tcp # RPC lockd/nlockmgr
|
||||||
|
rpc.lockd {{ nfs_rpc_lockd }}/udp # RPC lockd/nlockmgr
|
||||||
|
rpc.quotad {{ nfs_rpc_quotad }}/tcp # RPC quotad
|
||||||
|
rpc.quotad {{ nfs_rpc_quotad }}/udp # RPC quotad
|
||||||
|
when: nfs_cli_manage
|
||||||
# }}}
|
# }}}
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
|
# If you do not set values for the NEED_ options, they will be attempted
|
||||||
|
# autodetected; this should be sufficient for most people. Valid alternatives
|
||||||
|
# for the NEED_ options are "yes" and "no".
|
||||||
|
|
||||||
|
# Do you want to start the statd daemon? It is not needed for NFSv4.
|
||||||
|
NEED_STATD=
|
||||||
|
|
||||||
|
# Options for rpc.statd.
|
||||||
|
# Should rpc.statd listen on a specific port? This is especially useful
|
||||||
|
# when you have a port-based firewall. To use a fixed port, set this
|
||||||
|
# this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
|
||||||
|
# For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS
|
||||||
|
STATDOPTS="--port {{ nfs_rpc_statd_bc }} --outgoing-port {{ nfs_rpc_statd }}"
|
||||||
|
|
||||||
|
# Do you want to start the idmapd daemon? It is only needed for NFSv4.
|
||||||
|
NEED_IDMAPD=
|
||||||
|
|
||||||
|
# Do you want to start the gssd daemon? It is required for Kerberos mounts.
|
||||||
|
NEED_GSSD=
|
|
@ -0,0 +1,2 @@
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
RPCRQUOTADOPTS="-p {{ nfs_rpc_quotad }}"
|
Reference in New Issue