From c3f1ac6e6b738d1dbfa052aa2ba197777a5310a4 Mon Sep 17 00:00:00 2001 From: Daniel Clavijo Coca Date: Thu, 6 Aug 2026 12:05:11 +0200 Subject: [PATCH 1/2] F #239: Conditional ownership --- .gitignore | 1 + roles/helper/fstab/tasks/main.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 04b8cb82..8494e8b6 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ __pycache__/ .vscode .ansible/ .venv/ +.DS_Store diff --git a/roles/helper/fstab/tasks/main.yml b/roles/helper/fstab/tasks/main.yml index 1c4c4e0f..41e77269 100644 --- a/roles/helper/fstab/tasks/main.yml +++ b/roles/helper/fstab/tasks/main.yml @@ -66,9 +66,9 @@ - name: Ensure mountpoints with desired permissions exist ansible.builtin.file: path: "{{ item.path }}" - owner: "{{ item.owner }}" - group: "{{ item.group }}" - mode: "{{ item.mode }}" + owner: "{{ item.owner | default(omit, true) }}" + group: "{{ item.group | default(omit, true) }}" + mode: "{{ item.mode | default(omit, true) }}" state: directory loop: "{{ _fstab }}" From 03cb601d3a5de19a12f4254c8c798766ebac3019 Mon Sep 17 00:00:00 2001 From: Daniel Clavijo Coca Date: Thu, 6 Aug 2026 12:32:43 +0200 Subject: [PATCH 2/2] F #239: Update doc --- roles/helper/fstab/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/roles/helper/fstab/README.md b/roles/helper/fstab/README.md index 4c811277..8e814110 100644 --- a/roles/helper/fstab/README.md +++ b/roles/helper/fstab/README.md @@ -11,16 +11,16 @@ N/A Role Variables -------------- -| Name | Type | Default | Example | Description | -|------------------|---------|----------------------------------|---------------------------|-------------------------------------------------------| -| `fstab` | `list` | `[]` | | A list of mount definitions. | -| `fstab[].src` | `str` | undefined | `server:/srv/shared` | Device to be mounted on path. | -| `fstab[].path` | `str` | undefined | `/var/lib/one/datastores` | Path to the mountpoint. | -| `fstab[].fstype` | `str` | undefined | `nfs` | Filesystem type. | -| `fstab[].opts` | `str` | `rw,relatime,comment=one-deploy` | | Mount options. | -| `fstab[].owner` | `str` | `9869` | | Name/UID of the user that should own the mountpoint. | -| `fstab[].group` | `str` | `9869` | | Name/GID of the group that should own the mountpoint. | -| `fstab[].mode` | `str` | `u=rwx,g=rx,o=` | | The permissions the resulting mountpoint should have. | +| Name | Type | Default | Example | Description | +|------------------|---------|----------------------------------|---------------------------|--------------------------------------------------------------------------| +| `fstab` | `list` | `[]` | | A list of mount definitions. | +| `fstab[].src` | `str` | undefined | `server:/srv/shared` | Device to be mounted on path. | +| `fstab[].path` | `str` | undefined | `/var/lib/one/datastores` | Path to the mountpoint. | +| `fstab[].fstype` | `str` | undefined | `nfs` | Filesystem type. | +| `fstab[].opts` | `str` | `rw,relatime,comment=one-deploy` | | Mount options. | +| `fstab[].owner` | `str` | `9869` | | Name/UID of the user that should own the mountpoint. Use `null` to skip | +| `fstab[].group` | `str` | `9869` | | Name/GID of the group that should own the mountpoint. Use `null` to skip | +| `fstab[].mode` | `str` | `u=rwx,g=rx,o=` | | The permissions the resulting mountpoint should have. Use `null` to skip | Dependencies ------------