nomad/ansible/roles/configure-nfs-server/tasks/main.yml
2023-05-23 21:51:15 +01:00

28 lines
692 B
YAML

---
- name: install nfsd
become: true
ansible.builtin.apt:
name:
- nfs-kernel-server
- nfs-common
when: ansible_os_family == "Debian"
- name: configure nfsd
become: true
ansible.builtin.lineinfile:
path: /etc/exports
line: "{{ item }}"
state: present
create: yes
with_items:
- "/storage 10.10.0.4(rw,sync,no_subtree_check,no_root_squash)"
- "/storage 10.10.0.5(rw,sync,no_subtree_check,no_root_squash)"
- "/storage 10.10.0.6(rw,sync,no_subtree_check,no_root_squash)"
- name: restart nfsd
become: true
ansible.builtin.service:
name: nfs-kernel-server
state: restarted
enabled: yes
when: ansible_os_family == "Debian"