mirror of
https://github.com/geerlingguy/ansible-role-nfs
synced 2024-12-13 20:40:17 +01:00
29 lines
842 B
YAML
29 lines
842 B
YAML
---
|
|
# Include variables and define needed variables.
|
|
- name: Include OS-specific variables.
|
|
include_vars: "{{ ansible_os_family }}.yml"
|
|
when: ansible_os_family == 'Debian' or (ansible_os_family == 'RedHat' and ansible_distribution_major_version != '7')
|
|
|
|
- name: Inlcude Redhat 7 variables
|
|
include_vars: Redhat-7.yml
|
|
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
|
|
|
|
# Setup/install tasks.
|
|
- include: setup-RedHat.yml
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
- include: setup-Debian.yml
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
- name: Copy exports file.
|
|
template:
|
|
src: exports.j2
|
|
dest: /etc/exports
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: restart nfs
|
|
|
|
- name: Ensure nfs is running.
|
|
service: "name={{ nfs_server_daemon }} state=started enabled=yes"
|
|
when: nfs_exports|length
|