Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ __pycache__/
.vscode
.ansible/
.venv/
.DS_Store
20 changes: 10 additions & 10 deletions roles/helper/fstab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------
Expand Down
6 changes: 3 additions & 3 deletions roles/helper/fstab/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

Expand Down