61 lines
2.0 KiB
YAML
61 lines
2.0 KiB
YAML
---
|
|
# tasks file for role nfs
|
|
|
|
- name: load operating system specific variables for nfs
|
|
include_vars: "{{ item }}" # includes yml file containing os specific variable, eg "debian.yml" found in role_root/vars
|
|
with_first_found:
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
|
|
- "{{ ansible_distribution|lower }}.yml"
|
|
- "{{ ansible_os_family|lower }}.yml"
|
|
|
|
# client {{{
|
|
- name: ensure nfs client package is in the required install state
|
|
package:
|
|
name: '{{ item }}' # TODO: why not simply {{ nfs_cli_pkg_list }} ?
|
|
state: '{{ nfs_cli_pkg_state }}'
|
|
with_items:
|
|
- '{{ 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
|
|
# }}}
|