From 492388011e5ebd1d2343fc3a5eb7831392809c7b Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Tue, 22 Oct 2024 14:56:54 +0200 Subject: [PATCH] SYNO: add automounts Signed-off-by: Frank Villaro-Dixon --- ansible/configure-server.yml | 21 +++++++++++++++---- ansible/files/mnt-syno-InfraBackups.automount | 10 +++++++++ ansible/files/mnt-syno-k8home.automount | 10 +++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 ansible/files/mnt-syno-InfraBackups.automount create mode 100644 ansible/files/mnt-syno-k8home.automount diff --git a/ansible/configure-server.yml b/ansible/configure-server.yml index e955800..08d098c 100644 --- a/ansible/configure-server.yml +++ b/ansible/configure-server.yml @@ -21,20 +21,33 @@ - mnt-syno-k8home register: systemd_mount + + - name: Copy automount files + ansible.builtin.copy: + src: files/{{item}}.automount + dest: /etc/systemd/system/{{item}}.automount + owner: root + group: root + mode: 0644 + with_items: + - mnt-syno-InfraBackups + - mnt-syno-k8home + register: systemd_automount + - name: Reload systemd ansible.builtin.systemd: daemon_reload: yes - when: systemd_mount.changed + when: systemd_mount.changed or systemd_automount.changed - - name: Start & Enable systemd mount + - name: Start & Enable systemd automounts ansible.builtin.systemd: - name: "{{item}}.mount" + name: "{{item}}.automount" state: started enabled: yes with_items: - mnt-syno-InfraBackups - mnt-syno-k8home - when: systemd_mount.changed + when: systemd_automount.changed - name: Generate ssh key diff --git a/ansible/files/mnt-syno-InfraBackups.automount b/ansible/files/mnt-syno-InfraBackups.automount new file mode 100644 index 0000000..a15e800 --- /dev/null +++ b/ansible/files/mnt-syno-InfraBackups.automount @@ -0,0 +1,10 @@ +[Unit] +Description=Automount InfraBackups +After=network-online.target +Wants=network-online.target + +[Automount] +Where=/mnt/syno/InfraBackups + +[Install] +WantedBy=remote-fs.target \ No newline at end of file diff --git a/ansible/files/mnt-syno-k8home.automount b/ansible/files/mnt-syno-k8home.automount new file mode 100644 index 0000000..42a58cc --- /dev/null +++ b/ansible/files/mnt-syno-k8home.automount @@ -0,0 +1,10 @@ +[Unit] +Description=Automount k8home +After=network-online.target +Wants=network-online.target + +[Automount] +Where=/mnt/syno/k8home + +[Install] +WantedBy=remote-fs.target \ No newline at end of file