Ansible_workstation/roles/nfs_server/tasks/main.yml

24 lines
542 B
YAML
Raw Permalink Normal View History

2022-06-02 13:31:12 +00:00
---
# 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