24 lines
542 B
YAML
24 lines
542 B
YAML
|
---
|
||
|
# tasks file for nfs_server
|
||
|
- name: Install os-specific packages
|
||
|
include_tasks: "{{ ansible_os_family | lower }}.yml"
|
||
|
|
||
|
- name: Ensure directories to export exist
|
||
|
file: # noqa 208
|
||
|
path: "{{ item.src }}"
|
||
|
state: directory
|
||
|
with_items: "{{ nfs_exports }}"
|
||
|
|
||
|
- name: Copy exports file.
|
||
|
template:
|
||
|
src: exports.j2
|
||
|
dest: /etc/exports
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0644
|
||
|
notify: reload nfs
|
||
|
|
||
|
- name: Ensure nfs is running.
|
||
|
service: "name=nfs-kernel-server state=started enabled=yes"
|
||
|
when: nfs_exports|length
|