netz39-infra-ansible/roles/nfs-host/tasks/main.yml
Alexander Dahl a9e5a509a5 🚨 Fix wrong indentation
Fixes the following ansible-lint warnings:

    yaml[indentation]: Wrong indentation: expected 6 but found 4
    roles/nfs-host/tasks/main.yml:6

    yaml[indentation]: Wrong indentation: expected 6 but found 4
    roles/nginx_https_ingress/tasks/main.yml:11

    yaml[indentation]: Wrong indentation: expected 6 but found 4
    roles/nginx_https_ingress/tasks/main.yml:48
2025-02-19 21:55:53 +01:00

41 lines
964 B
YAML

---
- name: Install required packages
ansible.builtin.apt:
state: present
name:
- nfs-kernel-server
- nfs-common
- parted
- name: Create a new ext4 primary partition
community.general.parted:
device: "{{ nfs_host_storage_device }}"
number: 1
state: present
fs_type: ext4
- name: ensure nfs mountpoints exist
ansible.builtin.file:
path: "{{ item.directory }}"
state: directory
owner: nobody
group: nogroup
mode: '0777'
with_items: "{{ nfs_host_exports }}"
- name: Mount up device by label
ansible.posix.mount:
path: "{{ nfs_host_exports[0].directory }}"
src: /dev/sdb1
fstype: ext4
state: present
- name: template /etc/exports
ansible.builtin.template:
src: templates/exports.j2
dest: "/etc/exports"
notify: reload nfs
- name: Ensure nfs is running.
ansible.builtin.service: "name=nfs-kernel-server state=started enabled=yes"
when: nfs_host_exports|length