2023-09-29 14:26:07 +02:00
|
|
|
---
|
|
|
|
# - name: Create a new ext4 primary partition
|
|
|
|
# community.general.parted:
|
|
|
|
# device: "{{ nfs_host_storage_device }}"
|
|
|
|
# number: 1
|
|
|
|
# state: present
|
|
|
|
# fs_type: ext4
|
|
|
|
|
|
|
|
- name: Install nfs-kernel-server
|
|
|
|
ansible.builtin.apt:
|
|
|
|
state: present
|
|
|
|
name:
|
|
|
|
- nfs-kernel-server
|
|
|
|
|
|
|
|
- name: ensure nfs mountpoint is present
|
|
|
|
ansible.builtin.file:
|
2023-10-09 18:45:38 +02:00
|
|
|
path: "{{ item.directory }}"
|
2023-09-29 14:26:07 +02:00
|
|
|
state: directory
|
|
|
|
owner: nobody
|
|
|
|
group: nogroup
|
2023-10-09 18:24:53 +02:00
|
|
|
mode: '0000'
|
2023-10-09 18:45:38 +02:00
|
|
|
loop: "{{ nfs_host_exports | dict2items }}"
|
2023-09-29 09:38:36 +02:00
|
|
|
|
2023-10-09 18:45:38 +02:00
|
|
|
- name: template /etc/exports
|
2023-09-29 14:26:07 +02:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: templates/exports.j2
|
|
|
|
dest: "/etc/exports"
|
2023-09-29 09:38:36 +02:00
|
|
|
# restart nfs server
|