Files
computer-playbook/roles/user-backup/tasks/02_permissions_folders.yml
kevinveenbirkenbachandClaude Opus 5 37b4de82f0 style(user-backup): fit the ACL task name into the one-line ceiling
The name introduced in ebbf9d944 was 85 characters; tests/lint/repository/test_name_emoji_and_length.py caps task names at 80. It still carries the filesystem that decided the outcome, which was the point of templating it in.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 14:27:14 +02:00

40 lines
1.2 KiB
YAML

---
- name: 📦 Install ACL utilities
package_install:
id: acl
- name: ✅ Ensure backups root exists and owned by backup
file:
path: "{{ DIR_BACKUPS }}"
state: directory
owner: backup
group: backup
mode: "0700"
- name: 🔎 Detect the filesystem backing the backups root
ansible.builtin.command:
cmd: "findmnt -n -o FSTYPE --target {{ DIR_BACKUPS }}"
register: _backups_fstype
changed_when: false
- name: 🔎 Probe whether that filesystem serves POSIX ACLs
ansible.builtin.command:
cmd: "setfacl -m user:backup:rwx {{ DIR_BACKUPS }}"
register: _backups_acl_probe
changed_when: false
failed_when: false
- name: "🔐 Apply POSIX ACLs on {{ _backups_fstype.stdout | trim }}"
ansible.builtin.include_tasks: 02_permissions_folders/acl.yml
when: _backups_acl_probe.rc == 0
- name: 📁 Fix ownership level 0..2 directories to backup:backup
ansible.builtin.shell: >
find "{{ DIR_BACKUPS }}" -mindepth 0 -maxdepth 2 -xdev -type d -exec chown backup:backup {} +
changed_when: false
- name: 📁 Fix perms level 0..2 directories to 0700
ansible.builtin.shell: >
find "{{ DIR_BACKUPS }}" -mindepth 0 -maxdepth 2 -xdev -type d -exec chmod 700 {} +
changed_when: false