diff options
| author | Ahmed AbdelHalim <[email protected]> | 2026-07-19 00:23:36 +0200 |
|---|---|---|
| committer | Ahmed AbdelHalim <[email protected]> | 2026-07-19 00:23:36 +0200 |
| commit | 58a3f1ea5a2f18bb33593169382d7b246279968a (patch) | |
| tree | d1f7375ede93c47710fab15d2fb973e0f5bfdf86 | |
| parent | dca87a90dce0af8d1771638f210a65d5d1868511 (diff) | |
Rename backup -> mount as a role
| -rw-r--r-- | configure.yml | 2 | ||||
| -rw-r--r-- | host_vars/rpi5.local.yml | bin | 3940 -> 3939 bytes | |||
| -rw-r--r-- | host_vars/rpi5.local.yml.example | 2 | ||||
| -rw-r--r-- | molecule/raspberrypi/converge.yml | 10 | ||||
| -rw-r--r-- | roles/backup/defaults/main.yml | 4 | ||||
| -rw-r--r-- | roles/backup/tasks/main.yml | 18 | ||||
| -rw-r--r-- | roles/mount/README.md (renamed from roles/backup/README.md) | 16 | ||||
| -rw-r--r-- | roles/mount/defaults/main.yml | 4 | ||||
| -rw-r--r-- | roles/mount/meta/argument_specs.yml (renamed from roles/backup/meta/argument_specs.yml) | 14 | ||||
| -rw-r--r-- | roles/mount/meta/main.yml (renamed from roles/backup/meta/main.yml) | 2 | ||||
| -rw-r--r-- | roles/mount/tasks/main.yml | 18 |
11 files changed, 45 insertions, 45 deletions
diff --git a/configure.yml b/configure.yml index 540a51f4..9add9d57 100644 --- a/configure.yml +++ b/configure.yml @@ -97,7 +97,7 @@ - role: "prometheus-node-exporter" - role: "grafana" - role: "neomutt" - - role: "backup" + - role: "mount" - role: "garage" - role: "wakeonlan" diff --git a/host_vars/rpi5.local.yml b/host_vars/rpi5.local.yml Binary files differindex 427d7bcd..7f68115b 100644 --- a/host_vars/rpi5.local.yml +++ b/host_vars/rpi5.local.yml diff --git a/host_vars/rpi5.local.yml.example b/host_vars/rpi5.local.yml.example index 0d131cfb..426b4154 100644 --- a/host_vars/rpi5.local.yml.example +++ b/host_vars/rpi5.local.yml.example @@ -88,7 +88,7 @@ grafana_dashboards: - key: "${DS_prometheus}" value: "prometheus" -backup_device: "PARTLABEL=backup" +mount_device: "PARTLABEL=backup" garage_rpc_secret: "changeme" garage_access_key_id: "GK_changeme" garage_secret_access_key: "changeme" diff --git a/molecule/raspberrypi/converge.yml b/molecule/raspberrypi/converge.yml index f2397c17..ebbb1cbe 100644 --- a/molecule/raspberrypi/converge.yml +++ b/molecule/raspberrypi/converge.yml @@ -60,10 +60,10 @@ password_store_repo_url: "https://github.com/octocat/Spoon-Knife" firefox_install_browserpass: true firefox_install_passff: true - backup_mount_point: "/mnt/backup" - backup_device: "tmpfs" - backup_fstype: "tmpfs" - backup_mount_options: "defaults,mode=0755" + mount_point: "/mnt/backup" + mount_device: "tmpfs" + mount_fstype: "tmpfs" + mount_options: "defaults,mode=0755" pre_tasks: - name: "Override is_chroot fact for container environment" ansible.builtin.set_fact: @@ -93,7 +93,7 @@ - role: "prometheus" - role: "prometheus-node-exporter" - role: "grafana" - - role: "backup" + - role: "mount" - role: "garage" - role: "gnome" - role: "gnome-calendar" diff --git a/roles/backup/defaults/main.yml b/roles/backup/defaults/main.yml deleted file mode 100644 index 6fc18f9a..00000000 --- a/roles/backup/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -backup_mount_point: "/backup" -backup_fstype: "ext4" -backup_mount_options: "defaults,noatime" diff --git a/roles/backup/tasks/main.yml b/roles/backup/tasks/main.yml deleted file mode 100644 index 2180d659..00000000 --- a/roles/backup/tasks/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: "Create backup mount point" - become: true - ansible.builtin.file: - path: "{{ backup_mount_point }}" - state: "directory" - owner: "root" - group: "root" - mode: "0755" - -- name: "Mount backup drive" - become: true - ansible.posix.mount: - path: "{{ backup_mount_point }}" - src: "{{ backup_device }}" - fstype: "{{ backup_fstype }}" - opts: "{{ backup_mount_options }}" - state: "mounted" diff --git a/roles/backup/README.md b/roles/mount/README.md index 62cada76..c82c777a 100644 --- a/roles/backup/README.md +++ b/roles/mount/README.md @@ -1,25 +1,25 @@ -# Backup Role +# Mount Role -Mounts a dedicated backup drive on the target host. +Mounts a drive on the target host. ## Overview -Prepares a dedicated storage device as the local backup destination S3-compatible object store (ex. Garage). +Prepares a storage device as a mount point (e.g. local backup destination for S3-compatible object store like Garage). ## Configuration ### Required Variables ```yaml -backup_device: "PARTLABEL=backup" # no default — must set in host_vars +mount_device: "PARTLABEL=backup" # no default — must set in host_vars ``` ### Optional Variables ```yaml -backup_mount_point: "/backup" -backup_fstype: "ext4" -backup_mount_options: "defaults,noatime" +mount_point: "/backup" +mount_fstype: "ext4" +mount_options: "defaults,noatime" ``` ## Preparing the Drive @@ -63,7 +63,7 @@ ls /dev/disk/by-partlabel/ In `host_vars/rpi5.local.yml`: ```yaml -backup_device: "PARTLABEL=backup" +mount_device: "PARTLABEL=backup" ``` `PARTLABEL` is stable across reboots regardless of device enumeration order (`/dev/sda` vs `/dev/sdb`). diff --git a/roles/mount/defaults/main.yml b/roles/mount/defaults/main.yml new file mode 100644 index 00000000..325e0e51 --- /dev/null +++ b/roles/mount/defaults/main.yml @@ -0,0 +1,4 @@ +--- +mount_point: "/backup" +mount_fstype: "ext4" +mount_options: "defaults,noatime" diff --git a/roles/backup/meta/argument_specs.yml b/roles/mount/meta/argument_specs.yml index 459187ee..e74c1610 100644 --- a/roles/backup/meta/argument_specs.yml +++ b/roles/mount/meta/argument_specs.yml @@ -2,19 +2,19 @@ argument_specs: main: options: - backup_device: + mount_device: type: "str" description: "Device to mount (e.g. PARTLABEL=backup)" required: true - backup_mount_point: + mount_point: type: "str" - description: "Mount point for the backup drive" + description: "Mount point for the drive" default: "/mnt/backup" - backup_fstype: + mount_fstype: type: "str" - description: "Filesystem type of the backup device" + description: "Filesystem type of the device" default: "ext4" - backup_mount_options: + mount_options: type: "str" - description: "Mount options for the backup device" + description: "Mount options for the device" default: "defaults,noatime" diff --git a/roles/backup/meta/main.yml b/roles/mount/meta/main.yml index 616d6a42..ccb8c2a9 100644 --- a/roles/backup/meta/main.yml +++ b/roles/mount/meta/main.yml @@ -2,7 +2,7 @@ dependencies: [] galaxy_info: author: "a14m" - description: "Mount a dedicated backup drive" + description: "Mount a drive" license: "MIT" min_ansible_version: "2.18" platforms: diff --git a/roles/mount/tasks/main.yml b/roles/mount/tasks/main.yml new file mode 100644 index 00000000..65e40416 --- /dev/null +++ b/roles/mount/tasks/main.yml @@ -0,0 +1,18 @@ +--- +- name: "Create mount point" + become: true + ansible.builtin.file: + path: "{{ mount_point }}" + state: "directory" + owner: "root" + group: "root" + mode: "0755" + +- name: "Mount drive" + become: true + ansible.posix.mount: + path: "{{ mount_point }}" + src: "{{ mount_device }}" + fstype: "{{ mount_fstype }}" + opts: "{{ mount_options }}" + state: "mounted" |
