Mountoption sauber.

This commit is contained in:
2025-08-22 14:20:23 +02:00
parent 30ea8282fb
commit 56f18119b3
7 changed files with 30 additions and 16 deletions

View File

@@ -1,16 +1,28 @@
- name: Add Nextcloud mount to fstab
- name: create mount dir
become: true
ansible.builtin.blockinfile:
path: /etc/fstab
marker: "# {mark} ANSIBLE MANAGED BLOCK nextcloud"
block: |
PARTUUID={{ partuuid }} /mnt/nextcloud ext4 defaults,noatime,fail 0 1
file:
path: "/mnt/nextcloud"
state: directory
- name: Mount /mnt/nextcloud
- name: Backup der /etc/fstab anlegen
become: true
ansible.builtin.copy:
src: /etc/fstab
dest: /etc/fstab.backup.{{ ansible_date_time.iso8601 }}
remote_src: yes
mode: '0644'
- name: Ensure /mnt/nextcloud is mounted and in fstab
become: true
ansible.posix.mount:
path: /mnt/nextcloud
src: "PARTUUID={{ partuuid }}"
fstype: "ext4"
opts: "defaults,noatime"
state: mounted
fstype: ext4
src: PARTUUID={{ partuuid }}
- name: Facts aktualisieren
setup:
filter: ansible_mounts