cellinfo
/
ansible.nfs
Archived
2
0
Fork 0
This repository has been archived on 2020-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
ansible.nfs/tasks/main.yml

61 lines
2.0 KiB
YAML
Raw Normal View History

2017-07-20 11:44:10 +02:00
---
2017-10-03 16:01:03 +02:00
# tasks file for role nfs
2017-07-20 11:57:55 +02:00
2017-10-03 16:01:03 +02:00
- 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
2017-07-20 11:57:55 +02:00
with_first_found:
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution|lower }}.yml"
- "{{ ansible_os_family|lower }}.yml"
# client {{{
2017-10-03 16:01:03 +02:00
- name: ensure nfs client package is in the required install state
2017-07-20 11:57:55 +02:00
package:
2017-10-03 16:01:03 +02:00
name: '{{ item }}' # TODO: why not simply {{ nfs_cli_pkg_list }} ?
2017-07-20 11:57:55 +02:00
state: '{{ nfs_cli_pkg_state }}'
with_items:
- '{{ nfs_cli_pkg_list }}'
2017-07-20 15:55:21 +02:00
when: nfs_cli_manage
2017-10-03 16:01:03 +02:00
- name: configure nfs-client
2017-07-20 15:55:21 +02:00
template:
src: '{{ nfs_cli_conf_tpl }}'
dest: '{{ nfs_cli_conf_path }}'
owner: root
group: root
2017-07-20 16:36:13 +02:00
mode: 0644
backup: true
when: nfs_cli_manage
2017-10-03 16:01:03 +02:00
- name: configure nfs-quota
2017-07-20 16:36:13 +02:00
template:
src: '{{ nfs_quota_conf_tpl }}'
dest: '{{ nfs_quota_conf_path }}'
owner: root
group: root
2017-07-20 15:55:21 +02:00
mode: 0644
backup: true
when: nfs_cli_manage
2017-10-03 16:01:03 +02:00
- name: declare rpcbind ports in /etc/services
2017-07-20 16:06:23 +02:00
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
2017-07-20 11:57:55 +02:00
# }}}