From fb423359d2571ba24f4643e232e732ece26dfd37 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 29 Jun 2026 22:01:51 +0200 Subject: [PATCH] fix(user-backup): skip POSIX ACLs on NFS-backed backup roots setfacl returns "Operation not supported" on NFS exports, hard-failing the backup user setup in the swarm-nfs topology. Extract the ACL tasks into 03b_acl.yml and include them only when storage.backend \!= 'nfs'; chown backup:backup + 0700 already enforce the same posture on NFS. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../tasks/03_permissions_folders.yml | 44 ++---------------- roles/user-backup/tasks/03b_acl.yml | 46 +++++++++++++++++++ 2 files changed, 49 insertions(+), 41 deletions(-) create mode 100644 roles/user-backup/tasks/03b_acl.yml diff --git a/roles/user-backup/tasks/03_permissions_folders.yml b/roles/user-backup/tasks/03_permissions_folders.yml index 7e38f3fecf..11178002f2 100644 --- a/roles/user-backup/tasks/03_permissions_folders.yml +++ b/roles/user-backup/tasks/03_permissions_folders.yml @@ -12,47 +12,9 @@ group: backup mode: "0700" -- name: 🔐 Grant ACL rwx on backups root to backup user - ansible.posix.acl: - path: "{{ DIR_BACKUPS }}" - entity: backup - etype: user - permissions: rwx - state: present - -- name: 🔧 Set default ACL (inherit) for backup user under backups root - ansible.posix.acl: - path: "{{ DIR_BACKUPS }}" - entity: backup - etype: user - permissions: rwx - default: true - state: present - -- name: 🔐 Default ACL for backup user (inherit) - ansible.posix.acl: - path: "{{ DIR_BACKUPS }}" - etype: user - entity: backup - permissions: rwx - default: true - state: present - -- name: 🔐 Default ACL for group -> none - ansible.posix.acl: - path: "{{ DIR_BACKUPS }}" - etype: group - permissions: "---" - default: true - state: present - -- name: 🔐 Default ACL for other -> none - ansible.posix.acl: - path: "{{ DIR_BACKUPS }}" - etype: other - permissions: "---" - default: true - state: present +- name: 🔐 Apply POSIX ACLs for the backup user (non-NFS backends) + ansible.builtin.include_tasks: 03b_acl.yml + when: storage.backend != 'nfs' - name: 📁 Fix ownership level 0..2 directories to backup:backup ansible.builtin.shell: > diff --git a/roles/user-backup/tasks/03b_acl.yml b/roles/user-backup/tasks/03b_acl.yml new file mode 100644 index 0000000000..9b96b0bac3 --- /dev/null +++ b/roles/user-backup/tasks/03b_acl.yml @@ -0,0 +1,46 @@ +--- +# POSIX ACLs granting the backup user rwx (group/other none) with inheritance. +# Included only for non-NFS backends: NFS-backed backup roots reject setfacl with +# "Operation not supported", and the chown backup:backup + 0700 in the caller +# already enforce the same backup-only posture there. +- name: 🔐 Grant ACL rwx on backups root to backup user + ansible.posix.acl: + path: "{{ DIR_BACKUPS }}" + entity: backup + etype: user + permissions: rwx + state: present + +- name: 🔧 Set default ACL (inherit) for backup user under backups root + ansible.posix.acl: + path: "{{ DIR_BACKUPS }}" + entity: backup + etype: user + permissions: rwx + default: true + state: present + +- name: 🔐 Default ACL for backup user (inherit) + ansible.posix.acl: + path: "{{ DIR_BACKUPS }}" + etype: user + entity: backup + permissions: rwx + default: true + state: present + +- name: 🔐 Default ACL for group -> none + ansible.posix.acl: + path: "{{ DIR_BACKUPS }}" + etype: group + permissions: "---" + default: true + state: present + +- name: 🔐 Default ACL for other -> none + ansible.posix.acl: + path: "{{ DIR_BACKUPS }}" + etype: other + permissions: "---" + default: true + state: present